Commit 45af71c1 authored by Guido Giuntoli's avatar Guido Giuntoli

Implementing the homogenize linear public funcion

parent eff497f5
......@@ -341,6 +341,8 @@ class micropp {
void homogenize();
void homogenize_linear();
/* Extras */
int is_non_linear(const int gp_id) const;
......
......@@ -51,6 +51,8 @@ extern "C" {
void micropp3_homogenize(struct micropp3 *self);
void micropp3_homogenize_linear(struct micropp3 *self);
void micropp3_update_vars(struct micropp3 *self);
bool micropp3_is_non_linear(const struct micropp3 *self,
......
......@@ -57,6 +57,26 @@ void micropp<tdim>::get_ctan(const int gp_id, double *ctan) const
}
template <int tdim>
void micropp<tdim>::homogenize_linear()
{
INST_START;
#pragma omp parallel for schedule(dynamic,1)
for (int igp = 0; igp < ngp; ++igp) {
gp_t<tdim> *gp_ptr = &gp_list[igp];
/*
* Computational cheap calculation
* stress = ctan_lin * strain
*/
homogenize_linear(gp_ptr);
}
}
template <int tdim>
void micropp<tdim>::homogenize()
{
......
......@@ -91,6 +91,12 @@ module libmicropp
type(micropp3), intent(inout) :: this
end subroutine micropp3_homogenize
subroutine micropp3_homogenize_linear(this) bind(C)
import micropp3
implicit none
type(micropp3), intent(inout) :: this
end subroutine micropp3_homogenize_linear
logical(c_bool) function micropp3_is_non_linear(this, gp_id) bind(C)
use, intrinsic :: iso_c_binding, only: c_bool, c_int
import micropp3
......
......@@ -88,6 +88,12 @@ extern "C" {
ptr->homogenize();
}
void micropp3_homogenize_linear(micropp3 *self)
{
micropp<3> *ptr = (micropp<3> *) self->ptr;
ptr->homogenize_linear();
}
int micropp3_get_cost(const micropp3 *self, int gp_id)
{
micropp<3> *ptr = (micropp<3> *) self->ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment