Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
scalar_mixing_objective::scalar_mixing_objective_t Type Referenceabstract

An objective function corresponding to the mixing of a passive scalar \( F = \frac{1}{|\Omega_{obj}|}\int_{\Omega_{obj}} \frac{1}{2}\left(\phi - \phi_{ref}\right)^2 d\Omega, \). More...

Inheritance diagram for scalar_mixing_objective::scalar_mixing_objective_t:
Collaboration diagram for scalar_mixing_objective::scalar_mixing_objective_t:

Public Member Functions

procedure, pass(this), public init_json_sim (this, json, design, simulation)
 The common constructor using a JSON object.
 
procedure, pass(this), public init_from_attributes (this, design, simulation, weight, name, mask_name, phi_ref, scalar_name, start_time, end_time)
 The actual constructor.
 
procedure, pass(this), public free (this)
 Destructor.
 
procedure, pass(this), public update_value (this, design)
 Computes the value of the objective function.
 
procedure, pass(this), public update_sensitivity (this, design)
 Computes the sensitivity with respect to the coefficient \(\chi\).
 
procedure, pass(this) init_base (this, name, design_size, weight, mask_name, start_time, end_time)
 Initializer for the base class.
 
procedure, pass(this) free_base (this)
 Destructor of the base class.
 
procedure, pass(this) get_weight (this)
 Get the weight of the objective.
 
procedure, pass(this) get_log_size (this)
 Get number of log entries for this objective.
 
procedure, pass(this) get_log_size (this)
 Get number of log entries for this functional.
 
procedure, pass(this) get_log_headers (this, headers)
 Get header labels for this objective's log entries.
 
procedure, pass(this) get_log_headers (this, headers)
 Get header labels for this functional's log entries.
 
procedure, pass(this) get_log_values (this, values)
 Get values for this objective's log entries.
 
procedure, pass(this) get_log_values (this, values)
 Get values for this functional's log entries.
 
generic init (this, json, design)
 Constructor interface.
 
generic init (this, json, design, simulation)
 Constructor interface.
 
procedure, pass(this) init_json (this, json, design)
 Constructor based on json input.
 
procedure, pass(this) init_json_sim (this, json, design, simulation)
 Constructor based on json input and simulation.
 
procedure(functional_free), deferred, pass free (this)
 Destructor.
 
procedure(functional_update_value), deferred, pass update_value (this, design)
 Update the value of the function.
 
procedure(functional_update_sensitivity), deferred, pass update_sensitivity (this, design)
 Update the sensitivity of the function.
 
procedure, pass(this) get_value (this)
 Get the value of the function.
 
procedure, pass(this) get_sensitivity (this, sensitivity)
 Get the sensitivity of the function.
 
procedure, pass(this) reset_value (this)
 Set the value to zero.
 
procedure, pass(this) reset_sensitivity (this)
 Set the sensitivity to zero.
 
procedure, pass(this) accumulate_value (this, design, time)
 Accumulate the value.
 
procedure, pass(this) accumulate_sensitivity (this, design, time)
 Accumulate the sensitivity.
 

Public Attributes

real(kind=rp) phi_ref
 Target concentration in the optimized region \(\phi_{ref}\).
 
class(coef_t), pointer coef
 Coefficients defined on a given mesh.
 
real(kind=rp) domain_volume
 Volume of the domain \(|\Omega_{obj}|\).
 
character(len=:), allocatable scalar_name
 name of the scalar field being acted on
 
type(field_t), pointer u
 
type(field_t), pointer v
 
type(field_t), pointer w
 
type(field_t), pointer u_adj
 
type(field_t), pointer v_adj
 
type(field_t), pointer w_adj
 
real(kind=rp) weight = 1.0_rp
 Weight of the objective in the overall cost function.
 
character(len=25) name = ""
 Name of object in the logfile.
 
real(kind=rp) value = 0.0_dp
 Value of the base_functional.
 
type(vector_t) sensitivity
 Sensitivity field.
 
logical has_mask = .false.
 containing a mask
 
class(point_zone_t), pointer mask => null()
 A mask for where the objective function is evaluated.
 
real(kind=dp) start_time = 0.0_dp
 Time window start for accumulation.
 
real(kind=dp) end_time = huge(0.0_dp)
 Time window end for accumulation.
 
real(kind=xp) value_weight = 0.0_xp
 Length of time actually sampled by accumulate_value, used to normalise the running time average.
 
real(kind=xp) sensitivity_weight = 0.0_xp
 Length of time actually sampled by accumulate_sensitivity, used to normalise the running time average.
 

Detailed Description

Definition at line 66 of file scalar_mixing_objective_function.f90.

Member Function/Subroutine Documentation

◆ accumulate_sensitivity()

procedure, pass(this) base_functional::base_functional_t::accumulate_sensitivity ( class(base_functional_t), intent(inout)  this,
class(design_t), intent(in)  design,
type(time_state_t), intent(in)  time 
)
inherited

Normalised exactly as accumulate_value, so that the sensitivity stays consistent with the value it differentiates.

Parameters
thisThe functional.
designThe design.
timeThe current time state.

Definition at line 128 of file base_functional.f90.

◆ accumulate_value()

procedure, pass(this) base_functional::base_functional_t::accumulate_value ( class(base_functional_t), intent(inout)  this,
class(design_t), intent(in)  design,
type(time_state_t), intent(in)  time 
)
inherited

Updates the value in place as the running mean of the function.

The result is the running mean of the function over the part of the functional's own time window that has been simulated so far, normalised by the length of time actually sampled. It is therefore invariant to the length of the run: extending end_time of the simulation past the functional's window leaves the value unchanged, and a windowed functional reports the mean over its window rather than over the run.

Parameters
thisThe functional.
designThe design.
timeThe current time state.

Definition at line 126 of file base_functional.f90.

◆ free() [1/2]

procedure(functional_free), deferred, pass base_functional::base_functional_t::free ( class(base_functional_t), intent(inout)  this)
pure virtualinherited

Definition at line 103 of file base_functional.f90.

◆ free() [2/2]

procedure, pass(this), public scalar_mixing_objective::scalar_mixing_objective_t::free ( class(scalar_mixing_objective_t), intent(inout)  this)

Definition at line 95 of file scalar_mixing_objective_function.f90.

◆ free_base()

procedure, pass(this) objective::objective_t::free_base ( class(objective_t), intent(inout), target  this)
inherited

Definition at line 61 of file objective.f90.

◆ get_log_headers() [1/2]

procedure, pass(this) base_functional::base_functional_t::get_log_headers ( class(base_functional_t), intent(in)  this,
character(len=*), dimension(:), intent(out)  headers 
)
inherited
Parameters
[in]thisThe functional object.
[out]headersHeader labels for each log entry.

Definition at line 118 of file base_functional.f90.

◆ get_log_headers() [2/2]

procedure, pass(this) objective::objective_t::get_log_headers ( class(objective_t), intent(in)  this,
character(len=*), dimension(:), intent(out)  headers 
)
inherited
Parameters
[in]thisThe objective object.
[out]headersHeader labels for each log entry.

Definition at line 67 of file objective.f90.

◆ get_log_size() [1/2]

procedure, pass(this) base_functional::base_functional_t::get_log_size ( class(base_functional_t), intent(in)  this)
inherited
Parameters
[in]thisThe functional object.
Returns
n Number of log entries.

Definition at line 116 of file base_functional.f90.

◆ get_log_size() [2/2]

procedure, pass(this) objective::objective_t::get_log_size ( class(objective_t), intent(in)  this)
inherited
Parameters
[in]thisThe objective object.
Returns
n Number of log entries.

Definition at line 65 of file objective.f90.

◆ get_log_values() [1/2]

procedure, pass(this) base_functional::base_functional_t::get_log_values ( class(base_functional_t), intent(in)  this,
real(kind=rp), dimension(:), intent(out)  values 
)
inherited
Parameters
[in]thisThe functional object.
[out]valuesValues corresponding to the log headers.

Definition at line 120 of file base_functional.f90.

◆ get_log_values() [2/2]

procedure, pass(this) objective::objective_t::get_log_values ( class(objective_t), intent(in)  this,
real(kind=rp), dimension(:), intent(out)  values 
)
inherited
Parameters
[in]thisThe objective object.
[out]valuesValues corresponding to the log headers.

Definition at line 69 of file objective.f90.

◆ get_sensitivity()

procedure, pass(this) base_functional::base_functional_t::get_sensitivity ( class(base_functional_t), intent(in)  this,
type(vector_t), intent(inout)  sensitivity 
)
inherited

Definition at line 114 of file base_functional.f90.

◆ get_value()

procedure, pass(this) base_functional::base_functional_t::get_value ( class(base_functional_t), intent(in)  this)
inherited

Definition at line 112 of file base_functional.f90.

◆ get_weight()

procedure, pass(this) objective::objective_t::get_weight ( class(objective_t), intent(in)  this)
inherited

Definition at line 63 of file objective.f90.

◆ init() [1/2]

generic base_functional::base_functional_t::init ( class(base_functional_t), intent(inout)  this,
type(json_file), intent(inout)  json,
class(design_t), intent(in)  design 
)
inherited

Definition at line 96 of file base_functional.f90.

◆ init() [2/2]

generic base_functional::base_functional_t::init ( class(base_functional_t), intent(inout)  this,
type(json_file), intent(inout)  json,
class(design_t), intent(in)  design,
type(simulation_t), intent(inout), target  simulation 
)
inherited

Definition at line 96 of file base_functional.f90.

◆ init_base()

procedure, pass(this) objective::objective_t::init_base ( class(objective_t), intent(inout)  this,
character(len=*), intent(in)  name,
integer, intent(in)  design_size,
real(kind=rp), intent(in)  weight,
character(len=*), intent(in), optional  mask_name,
real(kind=rp), intent(in), optional  start_time,
real(kind=rp), intent(in), optional  end_time 
)
inherited
Parameters
thisThe objective.
nameThe name of the objective.
design_sizeThe number of design variables.
weightThe weight of the objective function.
mask_nameThe name design the mask. [optional]
start_timestart of the integration window. [optional]
end_timeend of the integration window. [optional]

Definition at line 59 of file objective.f90.

◆ init_from_attributes()

procedure, pass(this), public scalar_mixing_objective::scalar_mixing_objective_t::init_from_attributes ( class(scalar_mixing_objective_t), intent(inout)  this,
class(design_t), intent(in)  design,
type(simulation_t), intent(inout), target  simulation,
real(kind=rp), intent(in)  weight,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mask_name,
real(kind=rp), intent(in)  phi_ref,
character(len=*), intent(in)  scalar_name,
real(kind=rp), intent(in)  start_time,
real(kind=rp), intent(in)  end_time 
)
Parameters
thisThe object
designthe design.
simulationthe simulation.
weightthe weight of the objective function.
namethe name of the objective function.
mask_namethe name of the mask.
phi_reftarget concentration used in the objective function.
scalar_namename of the scalar field.
start_timestart of the integration window.
end_timeend of the integration window.

Definition at line 92 of file scalar_mixing_objective_function.f90.

◆ init_json()

procedure, pass(this) base_functional::base_functional_t::init_json ( class(base_functional_t), intent(inout)  this,
type(json_file), intent(inout)  json,
class(design_t), intent(in)  design 
)
inherited

Definition at line 99 of file base_functional.f90.

◆ init_json_sim() [1/2]

procedure, pass(this) base_functional::base_functional_t::init_json_sim ( class(base_functional_t), intent(inout)  this,
type(json_file), intent(inout)  json,
class(design_t), intent(in)  design,
type(simulation_t), intent(inout), target  simulation 
)
inherited

Definition at line 101 of file base_functional.f90.

◆ init_json_sim() [2/2]

procedure, pass(this), public scalar_mixing_objective::scalar_mixing_objective_t::init_json_sim ( class(scalar_mixing_objective_t), intent(inout)  this,
type(json_file), intent(inout)  json,
class(design_t), intent(in)  design,
type(simulation_t), intent(inout), target  simulation 
)
Parameters
thisThe object
jsonThe JSON subdictionary corresponding to your objective
designThe design
simulationThe simulation

Definition at line 89 of file scalar_mixing_objective_function.f90.

◆ reset_sensitivity()

procedure, pass(this) base_functional::base_functional_t::reset_sensitivity ( class(base_functional_t), intent(inout)  this)
inherited

Definition at line 124 of file base_functional.f90.

◆ reset_value()

procedure, pass(this) base_functional::base_functional_t::reset_value ( class(base_functional_t), intent(inout)  this)
inherited

Definition at line 122 of file base_functional.f90.

◆ update_sensitivity() [1/2]

procedure(functional_update_sensitivity), deferred, pass base_functional::base_functional_t::update_sensitivity ( class(base_functional_t), intent(inout)  this,
class(design_t), intent(in)  design 
)
pure virtualinherited

Definition at line 108 of file base_functional.f90.

◆ update_sensitivity() [2/2]

procedure, pass(this), public scalar_mixing_objective::scalar_mixing_objective_t::update_sensitivity ( class(scalar_mixing_objective_t), intent(inout)  this,
class(design_t), intent(in)  design 
)
Parameters
thisThe object.
designthe design.

Definition at line 100 of file scalar_mixing_objective_function.f90.

◆ update_value() [1/2]

procedure(functional_update_value), deferred, pass base_functional::base_functional_t::update_value ( class(base_functional_t), intent(inout)  this,
class(design_t), intent(in)  design 
)
pure virtualinherited

Definition at line 106 of file base_functional.f90.

◆ update_value() [2/2]

procedure, pass(this), public scalar_mixing_objective::scalar_mixing_objective_t::update_value ( class(scalar_mixing_objective_t), intent(inout)  this,
class(design_t), intent(in)  design 
)
Parameters
thisthe object.
designthe design.

Definition at line 97 of file scalar_mixing_objective_function.f90.

Member Data Documentation

◆ coef

class(coef_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::coef

Definition at line 74 of file scalar_mixing_objective_function.f90.

◆ domain_volume

real(kind=rp) scalar_mixing_objective::scalar_mixing_objective_t::domain_volume

Definition at line 76 of file scalar_mixing_objective_function.f90.

◆ end_time

real(kind=dp) base_functional::base_functional_t::end_time = huge(0.0_dp)
inherited

Definition at line 82 of file base_functional.f90.

◆ has_mask

logical base_functional::base_functional_t::has_mask = .false.
inherited

Definition at line 71 of file base_functional.f90.

◆ mask

class(point_zone_t), pointer base_functional::base_functional_t::mask => null()
inherited

Definition at line 73 of file base_functional.f90.

◆ name

character(len=25) base_functional::base_functional_t::name = ""
inherited

Definition at line 64 of file base_functional.f90.

◆ phi_ref

real(kind=rp) scalar_mixing_objective::scalar_mixing_objective_t::phi_ref

Definition at line 72 of file scalar_mixing_objective_function.f90.

◆ scalar_name

character(len=:), allocatable scalar_mixing_objective::scalar_mixing_objective_t::scalar_name

Definition at line 78 of file scalar_mixing_objective_function.f90.

◆ sensitivity

type(vector_t) base_functional::base_functional_t::sensitivity
inherited

Definition at line 69 of file base_functional.f90.

◆ sensitivity_weight

real(kind=xp) base_functional::base_functional_t::sensitivity_weight = 0.0_xp
inherited

Definition at line 88 of file base_functional.f90.

◆ start_time

real(kind=dp) base_functional::base_functional_t::start_time = 0.0_dp
inherited

Definition at line 80 of file base_functional.f90.

◆ u

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::u

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ u_adj

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::u_adj

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ v

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::v

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ v_adj

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::v_adj

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ value

real(kind=rp) base_functional::base_functional_t::value = 0.0_dp
inherited

Definition at line 67 of file base_functional.f90.

◆ value_weight

real(kind=xp) base_functional::base_functional_t::value_weight = 0.0_xp
inherited

Definition at line 85 of file base_functional.f90.

◆ w

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::w

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ w_adj

type(field_t), pointer scalar_mixing_objective::scalar_mixing_objective_t::w_adj

Definition at line 84 of file scalar_mixing_objective_function.f90.

◆ weight

real(kind=rp) objective::objective_t::weight = 1.0_rp
inherited

Definition at line 54 of file objective.f90.


The documentation for this type was generated from the following file: