Skip to content

Commit

Permalink
Indent and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed May 23, 2024
1 parent 1931c12 commit cb65ed1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions include/aspect/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -1246,25 +1246,22 @@ namespace aspect
namespace Tensors
{
/**
* Convert a vector of doubles to a SymmetricTensor of the same size.
* Convert a series of doubles to a SymmetricTensor of the same size.
*/
template <int dim>
inline
SymmetricTensor<2,dim>
to_symmetric_tensor(const ArrayView<const double> &values)
{
// Assemble stress tensor if elastic behavior is enabled
SymmetricTensor<2,dim> output;
for (unsigned int i=0; i < SymmetricTensor<2,dim>::n_independent_components; ++i)
output[SymmetricTensor<2,dim>::unrolled_to_component_indices(i)] = values[i];

return output;
};


}

/**
* Convert a vector of doubles to a SymmetricTensor of the same size.
/**
* Unroll a SymmetricTensor into a series of doubles.
*/
template <int dim>
inline
Expand All @@ -1274,7 +1271,7 @@ namespace aspect
{
for (unsigned int i=0; i < SymmetricTensor<2,dim>::n_independent_components; ++i)
values[i] = tensor[SymmetricTensor<2,dim>::unrolled_to_component_indices(i)];
};
}

/**
* Rotate a 3D 4th order tensor representing the full stiffnexx matrix using a 3D 2nd order rotation tensor
Expand Down
4 changes: 2 additions & 2 deletions source/particle/property/cpo_elastic_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace aspect
CpoElasticTensor<dim>::get_elastic_tensor(unsigned int cpo_data_position,
const ArrayView<double> &data)
{
ArrayView<const double> elastic_values(&data[cpo_data_position],SymmetricTensor<2,6>::n_independent_components);
const ArrayView<const double> elastic_values(&data[cpo_data_position],SymmetricTensor<2,6>::n_independent_components);
return Utilities::Tensors::to_symmetric_tensor<6>(elastic_values);
}

Expand All @@ -187,7 +187,7 @@ namespace aspect
const SymmetricTensor<2,6> &elastic_tensor)
{
const ArrayView<double> elastic_values(&data[cpo_data_position],SymmetricTensor<2,6>::n_independent_components);
Utilities::Tensors::unroll(elastic_tensor, data);
Utilities::Tensors::unroll(elastic_tensor, elastic_values);
}


Expand Down

0 comments on commit cb65ed1

Please sign in to comment.