Bases: object
solves the problem
u_i+k_{ij}*p_{,j} = g_i u_{i,i} = f
where p represents the pressure and u the Darcy flux. k represents the permeability,
Variables: |
|
---|
returns the flux for a given pressure p where the flux is equal to u0 on locations where location_of_fixed_flux is positive (see setValue). Notice that g is used, see setValue.
Parameters: |
|
---|---|
Returns: | flux |
Return type: | escript.Data |
Returns the solver options used to solve the flux problems :return: SolverOptions
Returns the solver options used to solve the pressure problems :return: SolverOptions
Sets the solver options used to solve the flux problems If options is not present, the options are reset to default :param options: SolverOptions
Sets the solver options used to solve the pressure problems If options is not present, the options are reset to default
Parameters: | options – SolverOptions |
---|---|
Note : | if the adaption of subtolerance is choosen, the tolerance set by options will be overwritten before the solver is called. |
assigns values to model parameters
Parameters: |
|
---|---|
Note : | the values of parameters which are not set by calling setValue are not altered. |
Note : | at any point on the boundary of the domain the pressure (location_of_fixed_pressure >0) or the normal component of the flux (location_of_fixed_flux[i]>0) if direction of the normal is along the x_i axis. |
solves the problem.
Parameters: |
|
---|---|
Returns: | flux and pressure |
Return type: | tuple of escript.Data. |
Bases: object
The FaultSystem class defines a system of faults in the Earth’s crust.
A fault system is defined by set of faults index by a tag. Each fault is defined by a starting point V0 and a list of strikes strikes and length l. The strikes and the length is used to define a polyline with points V[i] such that
So strikes defines the angle between the direction of the fault segment and the x0 axis. ls[i]==0 is allowed.
In case of a 3D model a fault plane is defined through a dip and depth.
The class provides a mechanism to parametrise each fault with the domain [0,w0_max] x [0, w1_max] (to [0,w0_max] in the 2D case).
adds a new fault to the fault system. The fault is named by tag.
The fault is defined by a starting point V0 and a list of strikes and length ls. The strikes and the length is used to define a polyline with points V[i] such that
So strikes defines the angle between the direction of the fault segment and the x0 axis. In 3D ls[i] ==0 is allowed.
In case of a 3D model a fault plane is defined through a dip dips and depth depths. From the dip and the depth the polyline bottom of the bottom of the fault is computed.
Each segment in the fault is decribed by the for vertices v0=top[i], v1==top[i+1], v2=bottom[i] and v3=bottom[i+1] The segment is parametrized by w0 and w1 with w0_offsets[i]<=w0<=w0_offsets[i+1] and -w1_max<=w1<=0. Moreover
If no w0_offsets is given,
where L[i] is the length of the segments on the top in 2D and in the middle of the segment in 3D.
If no w1_max is given, the average fault depth is used.
Parameters: |
|
---|---|
Note : | In the three dimensional case the lists dip and top must have the same length. |
returns the list of the vertices defining the bottom of the fault tag :param tag: the tag of the fault :type tag: float or str :return: the list of vertices. In the 2D case None is returned.
returns the center point of the fault system at the surface :rtype: numpy.array
returns the list of the depth vector at top vertices in fault tag. :param tag: the tag of the fault :type tag: float or str :return: the list of segment depths. In the 2D case None is returned.
returns the list of the depths of the segements in fault tag. :param tag: the tag of the fault :type tag: float or str :return: the list of segment depths. In the 2D case None is returned.
returns the spatial dimension :rtype: int
returns the list of the dips of the segements in fault tag :param tag: the tag of the fault :type tag: float or str :return: the list of segment dips. In the 2D case None is returned.
Returns: | the lengths of segments in fault tag |
---|---|
Return type: | list of float |
returns the tag of the fault of where f takes the maximum value and a Locator object which can be used to collect values from Data class objects at the location where the minimum is taken.
Parameters: |
|
---|---|
Returns: | the fault tag the maximum is taken, and a Locator object to collect the value at location of maximum value. |
returns the medium depth of fault tag :rtype: float
returns the tag of the fault of where f takes the minimum value and a Locator object which can be used to collect values from Data class objects at the location where the minimum is taken.
Parameters: |
|
---|---|
Returns: | the fault tag the minimum is taken, and a Locator object to collect the value at location of minimum value. |
returns the orientation of the fault system in RAD on the surface around the fault system center :rtype: float
returns the parametrization of the fault tag in the fault system. In fact the values of the parametrization for at given coordinates x is returned. In addition to the value of the parametrization a mask is returned indicating if the given location is on the fault with given tolerance tol.
Typical usage of the this method is
dom=Domain(..) x=dom.getX() fs=FaultSystem() fs.addFault(tag=3,...) p, m=fs.getParametrization(x, outsider=0,tag=3) saveDataCSV(‘x.csv’,p=p, x=x, mask=m)
to create a file with the coordinates of the points in x which are on the fault (as mask=m) together with their location p in the fault coordinate system.
Parameters: |
|
---|---|
Returns: | the coordinates x in the coordinate system of the fault and a mask indicating coordinates in the fault by 1 (0 elsewhere) |
Return type: | escript.Data object or numpy.array |
returns the list of the normals of the segments in fault tag :param tag: the tag of the fault :type tag: float or str :return: the list of vectors normal to the segments. In the 2D case None is returned.
returns the side and the distance at x from the fault tag.
Parameters: |
|
---|---|
Returns: | the side of x (positive means to the right of the fault, negative to the left) and the distance to the fault. Note that a value zero for the side means that that the side is undefined. |
returns the starting point of fault tag :rtype: numpy.array.
Returns: | the strike vectors of fault tag |
---|---|
Return type: | list of numpy.array. |
Returns: | the strike of the segements in fault tag |
---|---|
Return type: | list of float |
returns a list of the tags used by the fault system :rtype: list
returns the polyline used to describe fault tagged by tag
Parameters: | tag (float or str) – the tag of the fault |
---|---|
Returns: | the list of vertices defining the top of the fault. The coordinates are numpy.array. |
Returns: | the total unrolled length of fault tag |
---|---|
Return type: | float |
returns the offsets for the parametrization of fault tag.
Returns: | the offsets in the parametrization |
---|---|
Return type: | list of float |
returns the range of the parameterization in w0 :rtype: two float
returns the range of the parameterization in w1 :rtype: two float
applies a shift and a consecutive rotation in the x0x1 plane.
Parameters: |
|
---|
Bases: esys.escriptcore.rheologies.PowerLaw, esys.escriptcore.rheologies.Rheology, esys.escriptcore.flows.StokesProblemCartesian
This class implements the rheology of an isotropic Kelvin material.
Typical usage:
sp = IncompressibleIsotropicFlowCartesian(domain, stress=0, v=0)
sp.initialize(...)
v,p = sp.solve()
Note : | This model has been used in the self-consistent plate-mantle model proposed in U{Hans-Bernd Muhlhaus<emailto:h.muhlhaus@uq.edu.au>} and U{Klaus Regenauer-Lieb<mailto:klaus.regenauer-lieb@csiro.au>}: I{Towards a self-consistent plate mantle model that includes elasticity: simple benchmarks and application to basic modes of convection}, see U{doi: 10.1111/j.1365-246X.2005.02742.x<http://www3.interscience.wiley.com/journal/118661486/abstract>} |
---|
returns inner product of element p and div(v)
Parameters: | v – a residual |
---|---|
Returns: | inner product of element p and div(v) |
Return type: | float |
Returns True if verbose is switched on
Returns: | value of verbosity flag |
---|---|
Return type: | bool |
Returns the absolute tolerance.
Returns: | absolute tolerance |
---|---|
Return type: | float |
returns the effective viscosity used in the last iteration step of the last time step.
return the value for v for a given p
Parameters: |
|
---|---|
Returns: | dv given as Adv=(f-Av-B^*p) |
Returns deviatoric strain of current velocity or if v is present the deviatoric strain of velocity v:
Parameters: | v (Data of rank 1) – a velocity field |
---|---|
Returns: | deviatoric strain of the current velocity field or if v is present the deviatoric strain of velocity v |
Return type: | Data of rank 2 |
Returns current deviatoric stress.
Returns: | current deviatoric stress |
---|---|
Return type: | Data of rank 2 |
returns the domain.
Returns: | the domain |
---|---|
Return type: | Domain |
returns the elastic shear modulus.
Returns: | elastic shear modulus |
---|
returns the effective viscosity eta_eff such that
tau=eta_eff * gamma_dot
by solving a non-linear problem for tau.
Parameters: |
|
---|---|
Returns: | effective viscosity. |
returns the viscosity
Parameters: | id (int) – if present, the viscosity for material id is returned. |
---|---|
Returns: | the list of the viscosities for all matrials is returned. If id is present only the viscosity for material id is returned. |
returns the relative tolerance for the effectice viscosity.
Returns: | relative tolerance |
---|---|
Return type: | positive float |
Returns the external force
Returns: | external force |
---|---|
Return type: | Data |
returns the friction coefficient
Returns: | friction coefficient |
---|
Returns current second invariant of deviatoric strain rate or if D is present the second invariant of D.
Parameters: | D (Data of rank 0) – deviatoric strain rate tensor |
---|---|
Returns: | second invariant of deviatoric strain |
Return type: | scalar Data |
returns the numebr of materials
Returns: | number of materials |
---|---|
Return type: | int |
returns the power in the power law
Parameters: | id (int) – if present, the power for material id is returned. |
---|---|
Returns: | the list of the powers for all matrials is returned. If id is present only the power for material id is returned. |
Returns current pressure.
Returns: | current stress |
---|---|
Return type: | scalar Data |
Returns the restoring force factor
@return: restoring force factor @rtype: C{float} or L{Data}
returns the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
Return type: | SolverOptions |
---|
returns the solver options used solve the equation for pressure. :rtype: SolverOptions
returns the solver options used solve the equation for velocity.
Return type: | SolverOptions |
---|
Returns current stress.
Returns: | current stress |
---|---|
Return type: | Data of rank 2 |
Returns the surface force
Returns: | surface force |
---|---|
Return type: | Data |
Returns current second invariant of deviatoric stress
Returns: | second invariant of deviatoric stress |
---|---|
Return type: | scalar Data |
returns the transition stress
Parameters: | id (int) – if present, the transition stress for material id is returned. |
---|---|
Returns: | the list of the transition stresses for all matrials is returned. If id is present only the transition stress for material id is returned. |
returns the yield stress
Returns: | the yield stress |
---|
Returns current time.
Returns: | current time |
---|---|
Return type: | float |
Returns the relative tolerance.
Returns: | relative tolerance |
---|---|
Return type: | float |
Returns current velocity.
Returns: | current velocity |
---|---|
Return type: | vector Data |
Returns the constraint for the velocity as a pair of the mask of the location of the constraint and the values.
Returns: | the locations of fixed velocity and value of velocities at these locations |
---|---|
Return type: | tuple of Data s |
sets external forces and velocity constraints
Parameters: |
|
---|---|
Note : | Only changing parameters need to be specified. |
Returns inner product of p0 and p1
Parameters: |
|
---|---|
Returns: | inner product of p0 and p1 |
Return type: | float |
returns inner product of element p and Bv=-div(v)
Parameters: |
|
---|---|
Returns: | inner product of element p and Bv=-div(v) |
Return type: | float |
Returns Bv (overwrite).
Return type: | equal to the type of p |
---|---|
Note : | boundary conditions on p should be zero! |
calculates the norm of p
Parameters: | p – a pressure |
---|---|
Returns: | the norm of p using the inner product for pressure |
Return type: | float |
returns the norm of v
Parameters: | v – a velovity |
---|---|
Returns: | norm of v |
Return type: | non-negative float |
sets a control parameter
Parameters: |
|
---|
Sets the absolute tolerance.
Parameters: | tolerance (non-negative float) – tolerance to be used |
---|
sets a control parameter
Parameters: |
|
---|
set deviatoric strain
Parameters: | D (Data of rank 2) – new deviatoric strain. If D is not present the current velocity is used. |
---|
Sets the current deviatoric stress
Parameters: | stress (Data of rank 2) – new deviatoric stress |
---|
Sets the parameters for the Drucker-Prager model.
Parameters: |
|
---|
Sets the elastic shear modulus.
Parameters: | mu – elastic shear modulus |
---|
sets the relative tolerance for the effectice viscosity.
Parameters: | rtol (positive float) – relative tolerance |
---|
sets external forces and velocity constraints
Parameters: |
|
---|---|
Note : | Only changing parameters need to be specified. |
set the second invariant of deviatoric strain rate. If gammadot is not present zero is used.
Parameters: | gammadot (Data of rank 1) – second invariant of deviatoric strain rate. |
---|
Sets the power-law parameters for material id
Parameters: |
|
---|
Sets the parameters of the power-law for all materials.
Parameters: |
|
---|
Sets current pressure. :param p: new deviatoric stress :type p: scalar Data
set the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
Parameters: | options (SolverOptions) – new solver options |
---|
set the solver options for solving the equation for pressure. :param options: new solver options :type options: SolverOptions
set the solver options for solving the equation for velocity.
Parameters: | options (SolverOptions) – new solver options |
---|
Resets the current status given by pressure p and velocity v.
@param t: new time mark @type t: C{float} @param v: new current velocity @type v: vector L{Data} @param p: new deviatoric stress @type p: scalar L{Data} @param stress: new deviatoric stress @type stress: L{Data} of rank 2
assigns new values to the model parameters.
Parameters: |
|
---|
Updates current time.
Parameters: | t (float) – new time mark |
---|
Sets the relative tolerance for (v,p).
Parameters: | tolerance (non-negative float) – tolerance to be used |
---|
Sets current velocity.
Parameters: | v (vector Data) – new current velocity |
---|
Solves the saddle point problem using initial guesses v and p.
Parameters: |
|
---|---|
Return type: | tuple of Data objects |
Note : | typically this method is overwritten by a subclass. It provides a wrapper for the _solve method. |
Solves Av=B^*p with accuracy tol
Parameters: | p – a pressure increment |
---|---|
Returns: | the solution of Av=B^*p |
Note : | boundary conditions on v should be zero! |
applies preconditioner for for BA^{-1}B^* to Bv with accuracy self.getSubProblemTolerance()
Parameters: | Bv – velocity increment |
---|---|
Returns: | p=P(Bv) where P^{-1} is an approximation of BA^{-1}B^ * ) |
Note : | boundary conditions on p are zero. |
Updates stress, velocity and pressure for time increment dt.
Parameters: |
|
---|
updates the underlying Stokes equation to consider dependencies from v and p
checks if a given material id is valid
Parameters: | id (int) – a material id |
---|---|
Returns: | True is the id is valid |
Return type: | bool |
Bases: object
The level set method tracking an interface defined by the zero contour of the level set function phi which defines the signed distance of a point x from the interface. The contour phi(x)=0 defines the interface.
It is assumed that phi(x)<0 defines the volume of interest, phi(x)>0 the outside world.
Returns the solver options for the interface advective.
Returns the domain.
Returns the mesh size.
creates a characteristic function which is 1 over the over the length 2*h*smoothing_width around the interface and zero elsewhere
Creates a function with param_neg where phi<0 and param_pos where phi>0 (no smoothing).
Parameters: |
|
---|
Returns the level set function.
Returns the options of the solver for the reinitialization
Creates a smooth interface from -1 to 1 over the length 2*h*smoothing_width where -1 is used where the level set is negative and 1 where the level set is 1.
Creates a smoothed function with param_neg where phi<0 and param_pos where phi>0 which is smoothed over a length smoothing_width across the interface.
Parameters: | smoothing_width – width of the smoothing zone relative to mesh size. If not present the initial value of smooth is used. |
---|
Returns a new dt for a given flux using the Courant condition.
Parameters: | flux – flux field |
---|
Returns the volume of the phi(x)<0 region.
Makes a smooth characteristic function of the region phi(x)>contour if positiveSide and phi(x)<contour otherwise.
Parameters: |
|
---|
Updates the level set function.
Parameters: | dt – time step forward |
---|
Bases: esys.escriptcore.pdetools.SolverSchemeException
Exception thrown if the maximum number of iteration steps is reached.
Bases: object
The Mountains class is defined by the following equations:
Returns the domain.
Returns the time step value.
Return type: | float |
---|
returns the solver options for the smoothing/extrapolation
returns the solver options for the topograthy update
returns the current topography. :rtype: scalar Data
returns the smoothed/extrapolated velocity :rtype: vector Data
set the topography to H where H defines the vertical displacement. H is defined for the entire domain.
Parameters: | H (scalar) – the topography. If None zero is used. |
---|
set a new velocity. v is define on the entire domain but only the surface values are used.
Parameters: | v (vector) – velocity field. If None zero is used. |
---|
Sets a new W and updates the H function.
Parameters: | dt (positve float which is less or equal than the safe time step size.) – time step forward. If None the save time step size is used. |
---|
Bases: object
this implements the power law for a composition of a set of materials where the viscosity eta of each material is given by a power law relationship of the form
eta=eta_N*(tau/tau_t)**(1./power-1.)
where tau is equivalent stress and eta_N, tau_t and power are given constant. Moreover an elastic component can be considered. Moreover tau meets the Drucker-Prager type yield condition
tau <= tau_Y + friction * pressure
where gamma_dot is the equivalent.
returns the elastic shear modulus.
Returns: | elastic shear modulus |
---|
returns the effective viscosity eta_eff such that
tau=eta_eff * gamma_dot
by solving a non-linear problem for tau.
Parameters: |
|
---|---|
Returns: | effective viscosity. |
returns the viscosity
Parameters: | id (int) – if present, the viscosity for material id is returned. |
---|---|
Returns: | the list of the viscosities for all matrials is returned. If id is present only the viscosity for material id is returned. |
returns the relative tolerance for the effectice viscosity.
Returns: | relative tolerance |
---|---|
Return type: | positive float |
returns the friction coefficient
Returns: | friction coefficient |
---|
returns the numebr of materials
Returns: | number of materials |
---|---|
Return type: | int |
returns the power in the power law
Parameters: | id (int) – if present, the power for material id is returned. |
---|---|
Returns: | the list of the powers for all matrials is returned. If id is present only the power for material id is returned. |
returns the transition stress
Parameters: | id (int) – if present, the transition stress for material id is returned. |
---|---|
Returns: | the list of the transition stresses for all matrials is returned. If id is present only the transition stress for material id is returned. |
returns the yield stress
Returns: | the yield stress |
---|
Sets the parameters for the Drucker-Prager model.
Parameters: |
|
---|
Sets the elastic shear modulus.
Parameters: | mu – elastic shear modulus |
---|
sets the relative tolerance for the effectice viscosity.
Parameters: | rtol (positive float) – relative tolerance |
---|
Sets the power-law parameters for material id
Parameters: |
|
---|
Sets the parameters of the power-law for all materials.
Parameters: |
|
---|
checks if a given material id is valid
Parameters: | id (int) – a material id |
---|---|
Returns: | True is the id is valid |
Return type: | bool |
Bases: object
General framework to implement a rheology
Returns True if verbose is switched on
Returns: | value of verbosity flag |
---|---|
Return type: | bool |
Returns deviatoric strain of current velocity or if v is present the deviatoric strain of velocity v:
Parameters: | v (Data of rank 1) – a velocity field |
---|---|
Returns: | deviatoric strain of the current velocity field or if v is present the deviatoric strain of velocity v |
Return type: | Data of rank 2 |
Returns current deviatoric stress.
Returns: | current deviatoric stress |
---|---|
Return type: | Data of rank 2 |
returns the domain.
Returns: | the domain |
---|---|
Return type: | Domain |
Returns the external force
Returns: | external force |
---|---|
Return type: | Data |
Returns current second invariant of deviatoric strain rate or if D is present the second invariant of D.
Parameters: | D (Data of rank 0) – deviatoric strain rate tensor |
---|---|
Returns: | second invariant of deviatoric strain |
Return type: | scalar Data |
Returns current pressure.
Returns: | current stress |
---|---|
Return type: | scalar Data |
Returns the restoring force factor
@return: restoring force factor @rtype: C{float} or L{Data}
Returns current stress.
Returns: | current stress |
---|---|
Return type: | Data of rank 2 |
Returns the surface force
Returns: | surface force |
---|---|
Return type: | Data |
Returns current second invariant of deviatoric stress
Returns: | second invariant of deviatoric stress |
---|---|
Return type: | scalar Data |
Returns current time.
Returns: | current time |
---|---|
Return type: | float |
Returns current velocity.
Returns: | current velocity |
---|---|
Return type: | vector Data |
Returns the constraint for the velocity as a pair of the mask of the location of the constraint and the values.
Returns: | the locations of fixed velocity and value of velocities at these locations |
---|---|
Return type: | tuple of Data s |
set deviatoric strain
Parameters: | D (Data of rank 2) – new deviatoric strain. If D is not present the current velocity is used. |
---|
Sets the current deviatoric stress
Parameters: | stress (Data of rank 2) – new deviatoric stress |
---|
sets external forces and velocity constraints
Parameters: |
|
---|---|
Note : | Only changing parameters need to be specified. |
set the second invariant of deviatoric strain rate. If gammadot is not present zero is used.
Parameters: | gammadot (Data of rank 1) – second invariant of deviatoric strain rate. |
---|
Sets current pressure. :param p: new deviatoric stress :type p: scalar Data
Resets the current status given by pressure p and velocity v.
@param t: new time mark @type t: C{float} @param v: new current velocity @type v: vector L{Data} @param p: new deviatoric stress @type p: scalar L{Data} @param stress: new deviatoric stress @type stress: L{Data} of rank 2
Updates current time.
Parameters: | t (float) – new time mark |
---|
Sets current velocity.
Parameters: | v (vector Data) – new current velocity |
---|
Bases: esys.escriptcore.pdetools.HomogeneousSaddlePointProblem
solves
- -(eta*(u_{i,j}+u_{j,i}))_j + p_i = f_i-stress_{ij,j}
- u_{i,i}=0
u=0 where fixed_u_mask>0 eta*(u_{i,j}+u_{j,i})*n_j-p*n_i=surface_stress +stress_{ij}n_j
if surface_stress is not given 0 is assumed.
typical usage:
sp=StokesProblemCartesian(domain) sp.setTolerance() sp.initialize(...) v,p=sp.solve(v0,p0) sp.setStokesEquation(...) # new values for some parameters v1,p1=sp.solve(v,p)
returns inner product of element p and div(v)
Parameters: | v – a residual |
---|---|
Returns: | inner product of element p and div(v) |
Return type: | float |
Returns the absolute tolerance.
Returns: | absolute tolerance |
---|---|
Return type: | float |
return the value for v for a given p
Parameters: |
|
---|---|
Returns: | dv given as Adv=(f-Av-B^*p) |
returns the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
Return type: | SolverOptions |
---|
returns the solver options used solve the equation for pressure. :rtype: SolverOptions
returns the solver options used solve the equation for velocity.
Return type: | SolverOptions |
---|
Returns the relative tolerance.
Returns: | relative tolerance |
---|---|
Return type: | float |
assigns values to the model parameters
Parameters: |
|
---|
Returns inner product of p0 and p1
Parameters: |
|
---|---|
Returns: | inner product of p0 and p1 |
Return type: | float |
returns inner product of element p and Bv=-div(v)
Parameters: |
|
---|---|
Returns: | inner product of element p and Bv=-div(v) |
Return type: | float |
Returns Bv (overwrite).
Return type: | equal to the type of p |
---|---|
Note : | boundary conditions on p should be zero! |
calculates the norm of p
Parameters: | p – a pressure |
---|---|
Returns: | the norm of p using the inner product for pressure |
Return type: | float |
returns the norm of v
Parameters: | v – a velovity |
---|---|
Returns: | norm of v |
Return type: | non-negative float |
sets a control parameter
Parameters: |
|
---|
Sets the absolute tolerance.
Parameters: | tolerance (non-negative float) – tolerance to be used |
---|
sets a control parameter
Parameters: |
|
---|
set the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
Parameters: | options (SolverOptions) – new solver options |
---|
set the solver options for solving the equation for pressure. :param options: new solver options :type options: SolverOptions
set the solver options for solving the equation for velocity.
Parameters: | options (SolverOptions) – new solver options |
---|
assigns new values to the model parameters.
Parameters: |
|
---|
Sets the relative tolerance for (v,p).
Parameters: | tolerance (non-negative float) – tolerance to be used |
---|
Solves the saddle point problem using initial guesses v and p.
Parameters: |
|
---|---|
Return type: | tuple of Data objects |
Note : | typically this method is overwritten by a subclass. It provides a wrapper for the _solve method. |
Solves Av=B^*p with accuracy tol
Parameters: | p – a pressure increment |
---|---|
Returns: | the solution of Av=B^*p |
Note : | boundary conditions on v should be zero! |
applies preconditioner for for BA^{-1}B^* to Bv with accuracy self.getSubProblemTolerance()
Parameters: | Bv – velocity increment |
---|---|
Returns: | p=P(Bv) where P^{-1} is an approximation of BA^{-1}B^ * ) |
Note : | boundary conditions on p are zero. |
updates the Stokes equation to consider dependencies from v and p :note: This method can be overwritten by a subclass. Use setStokesEquation to set new values to model parameters.
Bases: exceptions.Exception
Thrown if the L{Mountains} class uses substepping.
Bases: esys.escriptcore.linearPDEs.TransportPDE
Represents and solves the temperature advection-diffusion problem
rhocp(T_{,t} + v_i T_{,i} - ( k T_{,i})_i = Q
k T_{,i}*n_i=surface_flux and T_{,t} = 0 where given_T_mask>0.
If surface_flux is not given 0 is assumed.
Typical usage:
sp = TemperatureCartesian(domain)
sp.setTolerance(1.e-4)
t = 0
T = ...
sp.setValues(rhocp=..., v=..., k=..., given_T_mask=...)
sp.setInitialTemperature(T)
while t < t_end:
sp.setValue(Q=...)
T = sp.getTemperature(dt)
t += dt
Announces that coefficient name has been changed.
Parameters: | name (string) – name of the coefficient affected |
---|---|
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE | |
Note : | if name is q or r, the method will not trigger a rebuild of the system as constraints are applied to the solved system. |
Tests two coefficients for reciprocal symmetry.
Parameters: |
|
---|---|
Returns: | True if coefficients name0 and name1 are reciprocally symmetric. |
Return type: | bool |
Tests a coefficient for symmetry.
Parameters: |
|
---|---|
Returns: | True if coefficient name is symmetric |
Return type: | bool |
Tests the transport problem for symmetry.
Parameters: | verbose (bool) – if set to True or not present a report on coefficients which break the symmetry is printed. |
---|---|
Returns: | True if the PDE is symmetric |
Return type: | bool |
Note : | This is a very expensive operation. It should be used for degugging only! The symmetry flag is not altered. |
Creates a Data object corresponding to coefficient name.
Returns: | the coefficient name initialized to 0 |
---|---|
Return type: | Data |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns an instance of a new transport operator.
Returns an instance of a new right hand side.
Returns an instance of a new solution.
Returns the value of the coefficient name.
Parameters: | name (string) – name of the coefficient requested |
---|---|
Returns: | the value of the coefficient |
Return type: | Data |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the operator in its current state.
Returns the right hand side in its current state.
Returns the solution in its current state.
Returns the spatial dimension of the PDE.
Returns: | the spatial dimension of the PDE domain |
---|---|
Return type: | int |
Returns the domain of the PDE.
Returns: | the domain of the PDE |
---|---|
Return type: | Domain |
Return the status indicator of the domain
Returns the FunctionSpace to be used for coefficient name.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | the function space to be used for coefficient name |
Return type: | FunctionSpace |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the FunctionSpace used to discretize the equation.
Returns: | representation space of equation |
---|---|
Return type: | FunctionSpace |
Returns the FunctionSpace used to represent the solution.
Returns: | representation space of solution |
---|---|
Return type: | FunctionSpace |
Returns the number of equations.
Returns: | the number of equations |
---|---|
Return type: | int |
Raises UndefinedPDEError: | |
if the number of equations is not specified yet |
Returns the number of unknowns.
Returns: | the number of unknowns |
---|---|
Return type: | int |
Raises UndefinedPDEError: | |
if the number of unknowns is not specified yet |
Returns the operator of the linear problem.
Returns: | the operator of the problem |
---|
Returns the current system type.
Returns the system type which needs to be used by the current set up.
Returns: | a code to indicate the type of transport problem scheme used |
---|---|
Return type: | float |
Returns the right hand side of the linear problem.
Returns: | the right hand side of the problem |
---|---|
Return type: | Data |
Returns a safe time step size to do the next time step.
Returns: | safe time step size |
---|---|
Return type: | float |
Note : | If not getSafeTimeStepSize() < getUnlimitedTimeStepSize() any time step size can be used. |
Returns the shape of the coefficient name.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | the shape of the coefficient name |
Return type: | tuple of int |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the solution by marching forward by time step dt. if ‘’u0’’ is present, ‘’u0’’ is used as the initial value otherwise the solution from the last call is used.
Parameters: |
|
---|---|
Returns: | the solution |
Return type: | Data |
Returns the solver options
Return type: | SolverOptions |
---|
Returns the operator and right hand side of the PDE.
Returns: | the discrete version of the PDE |
---|---|
Return type: | tuple of Operator and Data |
Return the domain status used to build the current system
Same as getSolution.
Returns the value returned by the getSafeTimeStepSize method to indicate no limit on the safe time step size.
return: the value used to indicate that no limit is set to the time step size rtype: float note: Typically the biggest positive float is returned
Returns True if name is the name of a coefficient.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | True if name is the name of a coefficient of the general PDE, False otherwise |
Return type: | bool |
Resets the system clearing the operator, right hand side and solution.
Introduces new coefficients into the problem.
Use:
p.introduceCoefficients(A=PDECoef(...), B=PDECoef(...))
to introduce the coefficients A and B.
Indicates the operator has to be rebuilt next time it is used.
Indicates the right hand side has to be rebuilt next time it is used.
Indicates the PDE has to be resolved if the solution is requested.
Announces that everything has to be rebuilt.
Returns True if the operator is still valid.
Returns True if the operator is still valid.
Returns True if the solution is still valid.
Checks if symmetry is indicated.
Returns: | True if a symmetric PDE is indicated, False otherwise |
---|---|
Return type: | bool |
Note : | the method is equivalent to use getSolverOptions().isSymmetric() |
Returns True if the system (including solution) is still vaild.
Checks if matrix lumping is the current solver method.
Returns: | True if the current solver method is lumping |
---|---|
Return type: | bool |
Returns the status of order reduction for the equation.
Returns: | True if reduced interpolation order is used for the representation of the equation, False otherwise |
---|---|
Return type: | bool |
Returns the status of order reduction for the solution.
Returns: | True if reduced interpolation order is used for the representation of the solution, False otherwise |
---|---|
Return type: | bool |
Resets all coefficients to their default values.
Makes sure that the operator is instantiated and returns it initialized with zeros.
Sets the right hand side to zero.
Resets all coefficients defining the right hand side
Sets the solution to zero.
Switches debug output on if flag is True, otherwise it is switched off.
Parameters: | flag (bool) – desired debug status |
---|
Switches debug output off.
Switches debug output on.
Sets the initial solution.
Parameters: | u (any object that can be interpolated to a Data object on Solution or ReducedSolution) – initial solution |
---|
Same as setInitialSolution.
Switches reduced order off for equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Switches reduced order on for equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for equation representation according to flag.
Parameters: | flag (bool) – if flag is True, the order reduction is switched on for equation representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Switches reduced order off for solution representation
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set. |
Switches reduced order on for solution representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for solution representation according to flag.
Parameters: | flag (bool) – if flag is True, the order reduction is switched on for solution representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Switches reduced order off for solution and equation representation
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Switches reduced order on for solution and equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for both solution and equation representation according to flag.
Parameters: | flag (bool) – if True, the order reduction is switched on for both solution and equation representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Sets the solution assuming that makes the system valid with the tolrance defined by the solver options
Sets the solver options.
Parameters: | options (SolverOptions or None) – the new solver options. If equal None, the solver options are set to the default. |
---|---|
Note : | The symmetry flag of options is overwritten by the symmetry flag of the LinearProblem. |
Sets the symmetry flag to flag.
Parameters: | flag (bool) – If True, the symmetry flag is set otherwise reset. |
---|---|
Note : | The method overwrites the symmetry flag set by the solver options |
Clears the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options
Sets the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options
Sets the system status to status if status is not present the current status of the domain is used.
Prints the text message if debug mode is switched on.
Parameters: | text (string) – message to be printed |
---|
Marks the operator as valid.
Marks the right hand side as valid.
Marks the solution as valid.
Bases: esys.escriptcore.linearPDEs.TransportPDE
Represents and solves the tracer problem
C_{,t} + v_i C_{,i} - ( k T_{,i})_i) = 0
C_{,t} = 0 where given_C_mask>0. C_{,i}*n_i=0
Typical usage:
sp = Tracer(domain)
sp.setTolerance(1.e-4)
t = 0
T = ...
sp.setValues(given_C_mask=...)
sp.setInitialTracer(C)
while t < t_end:
sp.setValue(v=...)
dt.getSaveTimeStepSize()
C = sp.getTracer(dt)
t += dt
Announces that coefficient name has been changed.
Parameters: | name (string) – name of the coefficient affected |
---|---|
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE | |
Note : | if name is q or r, the method will not trigger a rebuild of the system as constraints are applied to the solved system. |
Tests two coefficients for reciprocal symmetry.
Parameters: |
|
---|---|
Returns: | True if coefficients name0 and name1 are reciprocally symmetric. |
Return type: | bool |
Tests a coefficient for symmetry.
Parameters: |
|
---|---|
Returns: | True if coefficient name is symmetric |
Return type: | bool |
Tests the transport problem for symmetry.
Parameters: | verbose (bool) – if set to True or not present a report on coefficients which break the symmetry is printed. |
---|---|
Returns: | True if the PDE is symmetric |
Return type: | bool |
Note : | This is a very expensive operation. It should be used for degugging only! The symmetry flag is not altered. |
Creates a Data object corresponding to coefficient name.
Returns: | the coefficient name initialized to 0 |
---|---|
Return type: | Data |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns an instance of a new transport operator.
Returns an instance of a new right hand side.
Returns an instance of a new solution.
Returns the value of the coefficient name.
Parameters: | name (string) – name of the coefficient requested |
---|---|
Returns: | the value of the coefficient |
Return type: | Data |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the operator in its current state.
Returns the right hand side in its current state.
Returns the solution in its current state.
Returns the spatial dimension of the PDE.
Returns: | the spatial dimension of the PDE domain |
---|---|
Return type: | int |
Returns the domain of the PDE.
Returns: | the domain of the PDE |
---|---|
Return type: | Domain |
Return the status indicator of the domain
Returns the FunctionSpace to be used for coefficient name.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | the function space to be used for coefficient name |
Return type: | FunctionSpace |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the FunctionSpace used to discretize the equation.
Returns: | representation space of equation |
---|---|
Return type: | FunctionSpace |
Returns the FunctionSpace used to represent the solution.
Returns: | representation space of solution |
---|---|
Return type: | FunctionSpace |
Returns the number of equations.
Returns: | the number of equations |
---|---|
Return type: | int |
Raises UndefinedPDEError: | |
if the number of equations is not specified yet |
Returns the number of unknowns.
Returns: | the number of unknowns |
---|---|
Return type: | int |
Raises UndefinedPDEError: | |
if the number of unknowns is not specified yet |
Returns the operator of the linear problem.
Returns: | the operator of the problem |
---|
Returns the current system type.
Returns the system type which needs to be used by the current set up.
Returns: | a code to indicate the type of transport problem scheme used |
---|---|
Return type: | float |
Returns the right hand side of the linear problem.
Returns: | the right hand side of the problem |
---|---|
Return type: | Data |
Returns a safe time step size to do the next time step.
Returns: | safe time step size |
---|---|
Return type: | float |
Note : | If not getSafeTimeStepSize() < getUnlimitedTimeStepSize() any time step size can be used. |
Returns the shape of the coefficient name.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | the shape of the coefficient name |
Return type: | tuple of int |
Raises IllegalCoefficient: | |
if name is not a coefficient of the PDE |
Returns the solution by marching forward by time step dt. if ‘’u0’’ is present, ‘’u0’’ is used as the initial value otherwise the solution from the last call is used.
Parameters: |
|
---|---|
Returns: | the solution |
Return type: | Data |
Returns the solver options
Return type: | SolverOptions |
---|
Returns the operator and right hand side of the PDE.
Returns: | the discrete version of the PDE |
---|---|
Return type: | tuple of Operator and Data |
Return the domain status used to build the current system
Same as getSolution.
Returns the value returned by the getSafeTimeStepSize method to indicate no limit on the safe time step size.
return: the value used to indicate that no limit is set to the time step size rtype: float note: Typically the biggest positive float is returned
Returns True if name is the name of a coefficient.
Parameters: | name (string) – name of the coefficient enquired |
---|---|
Returns: | True if name is the name of a coefficient of the general PDE, False otherwise |
Return type: | bool |
Resets the system clearing the operator, right hand side and solution.
Introduces new coefficients into the problem.
Use:
p.introduceCoefficients(A=PDECoef(...), B=PDECoef(...))
to introduce the coefficients A and B.
Indicates the operator has to be rebuilt next time it is used.
Indicates the right hand side has to be rebuilt next time it is used.
Indicates the PDE has to be resolved if the solution is requested.
Announces that everything has to be rebuilt.
Returns True if the operator is still valid.
Returns True if the operator is still valid.
Returns True if the solution is still valid.
Checks if symmetry is indicated.
Returns: | True if a symmetric PDE is indicated, False otherwise |
---|---|
Return type: | bool |
Note : | the method is equivalent to use getSolverOptions().isSymmetric() |
Returns True if the system (including solution) is still vaild.
Checks if matrix lumping is the current solver method.
Returns: | True if the current solver method is lumping |
---|---|
Return type: | bool |
Returns the status of order reduction for the equation.
Returns: | True if reduced interpolation order is used for the representation of the equation, False otherwise |
---|---|
Return type: | bool |
Returns the status of order reduction for the solution.
Returns: | True if reduced interpolation order is used for the representation of the solution, False otherwise |
---|---|
Return type: | bool |
Resets all coefficients to their default values.
Makes sure that the operator is instantiated and returns it initialized with zeros.
Sets the right hand side to zero.
Resets all coefficients defining the right hand side
Sets the solution to zero.
Switches debug output on if flag is True, otherwise it is switched off.
Parameters: | flag (bool) – desired debug status |
---|
Switches debug output off.
Switches debug output on.
Sets the initial solution.
Parameters: | u (any object that can be interpolated to a Data object on Solution or ReducedSolution) – initial solution |
---|
Same as setInitialSolution.
Switches reduced order off for equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Switches reduced order on for equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for equation representation according to flag.
Parameters: | flag (bool) – if flag is True, the order reduction is switched on for equation representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Switches reduced order off for solution representation
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set. |
Switches reduced order on for solution representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for solution representation according to flag.
Parameters: | flag (bool) – if flag is True, the order reduction is switched on for solution representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Switches reduced order off for solution and equation representation
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Switches reduced order on for solution and equation representation.
Raises RuntimeError: | |
---|---|
if order reduction is altered after a coefficient has been set |
Sets order reduction state for both solution and equation representation according to flag.
Parameters: | flag (bool) – if True, the order reduction is switched on for both solution and equation representation, otherwise or if flag is not present order reduction is switched off |
---|---|
Raises RuntimeError: | |
if order reduction is altered after a coefficient has been set |
Sets the solution assuming that makes the system valid with the tolrance defined by the solver options
Sets the solver options.
Parameters: | options (SolverOptions or None) – the new solver options. If equal None, the solver options are set to the default. |
---|---|
Note : | The symmetry flag of options is overwritten by the symmetry flag of the LinearProblem. |
Sets the symmetry flag to flag.
Parameters: | flag (bool) – If True, the symmetry flag is set otherwise reset. |
---|---|
Note : | The method overwrites the symmetry flag set by the solver options |
Clears the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options
Sets the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options
Sets the system status to status if status is not present the current status of the domain is used.
Prints the text message if debug mode is switched on.
Parameters: | text (string) – message to be printed |
---|
Marks the operator as valid.
Marks the right hand side as valid.
Marks the solution as valid.