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

The base functional type. More...

Inheritance diagram for base_functional::base_functional_t:
Collaboration diagram for base_functional::base_functional_t:

Public Member Functions

generic init (this, json, design)
 Constructor interface.
 
generic init (this, json, design, simulation)
 Constructor interface.
 
procedure, pass(thisinit_json (this, json, design)
 Constructor based on json input.
 
procedure, pass(thisinit_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(thisget_value (this)
 Get the value of the function.
 
procedure, pass(thisget_sensitivity (this, sensitivity)
 Get the sensitivity of the function.
 
procedure, pass(thisget_log_size (this)
 Get number of log entries for this functional.
 
procedure, pass(thisget_log_headers (this, headers)
 Get header labels for this functional's log entries.
 
procedure, pass(thisget_log_values (this, values)
 Get values for this functional's log entries.
 
procedure, pass(thisreset_value (this)
 Set the value to zero.
 
procedure, pass(thisreset_sensitivity (this)
 Set the sensitivity to zero.
 
procedure, pass(thisaccumulate_value (this, design, time)
 Accumulate the value.
 
procedure, pass(thisaccumulate_sensitivity (this, design, time)
 Accumulate the sensitivity.
 

Public Attributes

real(kind=rp) value = 0.0_rp
 Value of the base_functional.
 
real(kind=rp) value_old = 0.0_rp
 Old value for time integration.
 
type(vector_t) sensitivity
 Sensitivity field.
 
type(vector_t) sensitivity_old
 Old sensitivity field for time integration.
 
character(len=25) name = ""
 Name of constraint/objective in the logfile.
 
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=rp) start_time = 0.0_rp
 Time window start for accumulation.
 
real(kind=rp) end_time = huge(0.0_rp)
 Time window end for accumulation.
 

Detailed Description

This is the base class for objectives and constraints alike. A base functional should be able to evaluate itself and its sensitivity with respect to the design variables.

The base functional is also responsible for managing the adjoint forcing terms that are required for the adjoint problem, any source terms simulation components that are required to evaluate the base functional. All of which should be prepared in the init method.

Definition at line 60 of file base_functional.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 
)

Definition at line 119 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 
)

Definition at line 117 of file base_functional.f90.

◆ free()

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

Definition at line 94 of file base_functional.f90.

◆ get_log_headers()

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

Definition at line 109 of file base_functional.f90.

◆ get_log_size()

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

Definition at line 107 of file base_functional.f90.

◆ get_log_values()

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 
)
Parameters
[in]thisThe functional object.
[out]valuesValues corresponding to the log headers.

Definition at line 111 of file base_functional.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 
)

Definition at line 105 of file base_functional.f90.

◆ get_value()

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

Definition at line 103 of file base_functional.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 
)

Definition at line 87 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 
)

Definition at line 87 of file base_functional.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 
)

Definition at line 90 of file base_functional.f90.

◆ init_json_sim()

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 
)

Definition at line 92 of file base_functional.f90.

◆ reset_sensitivity()

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

Definition at line 115 of file base_functional.f90.

◆ reset_value()

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

Definition at line 113 of file base_functional.f90.

◆ update_sensitivity()

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 virtual

Definition at line 99 of file base_functional.f90.

◆ update_value()

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 virtual

Definition at line 97 of file base_functional.f90.

Member Data Documentation

◆ end_time

real(kind=rp) base_functional::base_functional_t::end_time = huge(0.0_rp)

Definition at line 79 of file base_functional.f90.

◆ has_mask

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

Definition at line 73 of file base_functional.f90.

◆ mask

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

Definition at line 75 of file base_functional.f90.

◆ name

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

Definition at line 71 of file base_functional.f90.

◆ sensitivity

type(vector_t) base_functional::base_functional_t::sensitivity

Definition at line 67 of file base_functional.f90.

◆ sensitivity_old

type(vector_t) base_functional::base_functional_t::sensitivity_old

Definition at line 69 of file base_functional.f90.

◆ start_time

real(kind=rp) base_functional::base_functional_t::start_time = 0.0_rp

Definition at line 77 of file base_functional.f90.

◆ value

real(kind=rp) base_functional::base_functional_t::value = 0.0_rp

Definition at line 63 of file base_functional.f90.

◆ value_old

real(kind=rp) base_functional::base_functional_t::value_old = 0.0_rp

Definition at line 65 of file base_functional.f90.


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