add another 67 degree break condition
This commit is contained in:
parent
c9deacfd3c
commit
c39a976ebd
5 changed files with 17 additions and 7 deletions
|
|
@ -496,13 +496,14 @@ void Mesh::Visualize_paraview(vector<double> const &v) const
|
|||
return;
|
||||
}
|
||||
|
||||
double Mesh::AverageVectorFunction_perSubdomain(std::vector<double> &v, int target_sd) const
|
||||
std::tuple<double,double> Mesh::AverageVectorFunction_perSubdomain(std::vector<double> &v, int target_sd) const
|
||||
{
|
||||
assert(2==Ndims());
|
||||
int const nnode = Nnodes(); // number of vertices in mesh
|
||||
assert( nnode == static_cast<int>(v.size()) );
|
||||
|
||||
double cumulative_element_temp = 0.0;
|
||||
double elements_temp_reached = 0.0;
|
||||
int subdomain_element_counter = 0;
|
||||
for (int e = 0; e < Nelems(); ++e) // loop over all elements
|
||||
{
|
||||
|
|
@ -518,14 +519,19 @@ double Mesh::AverageVectorFunction_perSubdomain(std::vector<double> &v, int targ
|
|||
cumulative_node_temp += v[node]; // set function
|
||||
}
|
||||
cumulative_element_temp += cumulative_node_temp/_nvert_e;
|
||||
|
||||
|
||||
if (cumulative_node_temp/_nvert_e > 67.0) // check if element has reached temp
|
||||
{
|
||||
elements_temp_reached++; // add to counter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cumulative_element_temp/subdomain_element_counter;
|
||||
// average temperature % of elements reached temperature 67
|
||||
return std::make_tuple(cumulative_element_temp/subdomain_element_counter, 100 * elements_temp_reached / static_cast<double>(subdomain_element_counter));
|
||||
}
|
||||
|
||||
|
||||
|
||||
vector<int> Mesh::Index_DirichletNodes() const
|
||||
{
|
||||
assert(2==Ndims()); // not in 3D currently
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue