50 #if !defined(KRATOS_EDGE_DATA_C2C_H_INCLUDED)
51 #define KRATOS_EDGE_DATA_C2C_H_INCLUDED
54 #define USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
70 #include "utilities/geometry_utilities.h"
78 template <
unsigned int TDim>
86 boost::numeric::ublas::bounded_matrix<double, TDim, TDim>
LaplacianIJ;
101 for (
unsigned int comp = 0; comp < TDim; comp++)
102 destination[comp] -=
Ni_DNj[comp] * p_j -
DNi_Nj[comp] * p_i;
107 for (
unsigned int comp = 0; comp < TDim; comp++)
108 destination[comp] +=
Ni_DNj[comp] * p_j -
DNi_Nj[comp] * p_i;
120 for (
unsigned int comp = 0; comp < TDim; comp++)
121 destination +=
Ni_DNj[comp] * (v_j[comp] - v_i[comp]);
128 for (
unsigned int comp = 0; comp < TDim; comp++)
129 destination -=
Ni_DNj[comp] * (v_j[comp] - v_i[comp]);
139 for (
unsigned int comp = 0; comp < TDim; comp++)
140 destination[comp] +=
Ni_DNj[comp] * (p_j - p_i);
145 for (
unsigned int comp = 0; comp < TDim; comp++)
146 destination[comp] -=
Ni_DNj[comp] * (p_j - p_i);
158 for (
unsigned int comp = 0; comp < TDim; comp++)
159 destination -=
Ni_DNj[comp] * v_j[comp] -
DNi_Nj[comp] * v_i[comp];
166 for (
unsigned int comp = 0; comp < TDim; comp++)
167 destination +=
Ni_DNj[comp] * v_j[comp] -
DNi_Nj[comp] * v_i[comp];
177 for (
unsigned int comp = 1; comp < TDim; comp++)
185 double second = a_i[0] *
DNi_Nj[0];
186 double first = a_j[0] *
Ni_DNj[0];
187 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
189 second += a_i[k_comp] *
DNi_Nj[k_comp];
190 first += a_j[k_comp] *
Ni_DNj[k_comp];
192 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
193 destination[l_comp] += first * U_j[l_comp] - second * U_i[l_comp];
200 double second = a_i[0] *
DNi_Nj[0];
201 double first = a_j[0] *
Ni_DNj[0];
202 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
204 second += a_i[k_comp] *
DNi_Nj[k_comp];
205 first += a_j[k_comp] *
Ni_DNj[k_comp];
207 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
208 destination[l_comp] -= first * U_j[l_comp] - second * U_i[l_comp];
216 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
218 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
221 destination -=
temp * (phi_j - phi_i);
223 double aux_i = a_i[0] *
Ni_DNj[0];
224 double aux_j = a_j[0] *
Ni_DNj[0];
225 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
227 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
228 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
230 destination -= aux_j * phi_j - aux_i * phi_i;
239 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
241 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
244 destination +=
temp * (phi_j - phi_i);
246 double aux_i = a_i[0] *
Ni_DNj[0];
247 double aux_j = a_j[0] *
Ni_DNj[0];
248 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
250 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
251 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
253 destination += aux_j * phi_j - aux_i * phi_i;
264 double conv_stab = 0.0;
265 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
266 for (
unsigned int m_comp = 0; m_comp < TDim; m_comp++)
267 conv_stab += a_i[k_comp] * a_i[m_comp] *
LaplacianIJ(k_comp, m_comp);
268 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
269 stab_low[l_comp] = conv_stab * (U_j[l_comp] - U_i[l_comp]);
277 double conv_stab = 0.0;
278 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
279 for (
unsigned int m_comp = 0; m_comp < TDim; m_comp++)
280 conv_stab += a_i[k_comp] * a_i[m_comp] *
LaplacianIJ(k_comp, m_comp);
281 stab_low = conv_stab * (phi_j - phi_i);
291 #ifdef USE_CONSERVATIVE_FORM_FOR_VECTOR_CONVECTION
293 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
295 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
296 stab_high[l_comp] = -
temp * (pi_j[l_comp] - pi_i[l_comp]);
298 double aux_i = a_i[0] *
Ni_DNj[0];
299 double aux_j = a_j[0] *
Ni_DNj[0];
300 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
302 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
303 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
305 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
306 stab_high[l_comp] = -(aux_j * pi_j[l_comp] - aux_i * pi_i[l_comp]);
315 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
317 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
320 stab_high = -
temp * (pi_j - pi_i);
322 double aux_i = a_i[0] *
Ni_DNj[0];
323 double aux_j = a_j[0] *
Ni_DNj[0];
324 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
326 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
327 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
330 stab_high = -(aux_j * pi_j - aux_i * pi_i);
337 const double tau,
const double beta,
340 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
341 destination[l_comp] +=
tau * (stab_low[l_comp] - beta * stab_high[l_comp]);
345 const double tau,
const double beta,
346 const double &stab_low,
const double &stab_high)
348 destination +=
tau * (stab_low - beta * stab_high);
352 const double tau,
const double beta,
355 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
356 destination[l_comp] -=
tau * (stab_low[l_comp] - beta * stab_high[l_comp]);
360 const double tau,
const double beta,
361 const double &stab_low,
const double &stab_high)
363 destination -=
tau * (stab_low - beta * stab_high);
375 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
379 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
380 destination[l_comp] += nu_i *
L * (U_j[l_comp] - U_i[l_comp]);
389 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
393 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
394 destination[l_comp] -= nu_i *
L * (U_j[l_comp] - U_i[l_comp]);
400 template <
unsigned int TDim,
class TSparseSpace>
428 return mNonzeroEdgeValues;
438 return mRowStartIndex;
443 return mLumpedMassMatrix;
448 return mInvertedMassMatrix;
453 return mDiagGradientMatrix;
479 for (
typename ModelPart::NodesContainerType::iterator node_it =
model_part.NodesBegin(); node_it !=
model_part.NodesEnd(); node_it++)
482 mNumberEdges += (node_it->GetValue(NEIGHBOUR_NODES)).size();
485 node_it->FastGetSolutionStepValue(AUX_INDEX) =
static_cast<double>(i_node++);
489 KRATOS_WATCH(
"ERROR - Highest nodal index doesn't coincide with number of nodes!");
492 mNonzeroEdgeValues.resize(mNumberEdges);
494 mColumnIndex.resize(mNumberEdges);
496 mRowStartIndex.resize(
n_nodes + 1);
498 mLumpedMassMatrix.resize(
n_nodes);
500 mInvertedMassMatrix.resize(
n_nodes);
502 mDiagGradientMatrix.resize(
n_nodes);
510 unsigned int row_start_temp = 0;
513 std::vector<int> row_partition(number_of_threads);
516 for (
int k = 0;
k < number_of_threads;
k++)
522 for (
unsigned int aux_i =
static_cast<unsigned int>(row_partition[
k]); aux_i < static_cast<unsigned int>(row_partition[
k + 1]); aux_i++)
524 typename ModelPart::NodesContainerType::iterator node_it =
model_part.NodesBegin() + aux_i;
527 i_node =
static_cast<unsigned int>(node_it->FastGetSolutionStepValue(AUX_INDEX));
533 unsigned int n_neighbours = neighb_nodes.
size();
537 std::vector<unsigned int> work_array;
538 work_array.reserve(n_neighbours);
545 work_array.push_back(
static_cast<unsigned int>(neighb_it->FastGetSolutionStepValue(AUX_INDEX)));
548 std::sort(work_array.begin(), work_array.end());
551 mRowStartIndex[i_node] = row_start_temp;
556 unsigned int j_neighbour = work_array[
counter];
559 unsigned int csr_index = mRowStartIndex[i_node] +
counter;
562 mColumnIndex[csr_index] = j_neighbour;
565 row_start_temp += n_neighbours;
570 mRowStartIndex[
n_nodes] = mNumberEdges;
575 mHmin[i_node] = 1e10;
594 boost::numeric::ublas::bounded_matrix<double, TDim + 1, TDim> dN_dx;
598 double weighting_factor = 1.0 /
static_cast<double>(TDim + 1);
600 boost::numeric::ublas::bounded_matrix<double, TDim + 1, TDim + 1> mass_consistent;
609 for (
typename ModelPart::ElementsContainerType::iterator elem_it =
model_part.ElementsBegin(); elem_it !=
model_part.ElementsEnd(); elem_it++)
617 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
619 heights[ie_node] = dN_dx(ie_node, 0) * dN_dx(ie_node, 0);
620 for (
unsigned int comp = 1; comp < TDim; comp++)
622 heights[ie_node] += dN_dx(ie_node, comp) * dN_dx(ie_node, comp);
624 heights[ie_node] = 1.0 / sqrt(heights[ie_node]);
628 CalculateMassMatrix(mass_consistent,
volume);
630 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
632 for (
unsigned int je_node = 0; je_node <= TDim; je_node++)
635 mass_lumped[ie_node] += mass_consistent(ie_node, je_node);
640 double weighted_volume =
volume * weighting_factor;
645 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
646 nodal_indices[ie_node] =
static_cast<unsigned int>(elem_it->GetGeometry()[ie_node].FastGetSolutionStepValue(AUX_INDEX));
649 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
652 if (mHmin[nodal_indices[ie_node]] > heights[ie_node])
653 mHmin[nodal_indices[ie_node]] = heights[ie_node];
655 for (
unsigned int je_node = 0; je_node <= TDim; je_node++)
659 if (ie_node != je_node)
662 unsigned int csr_index =
GetCSRIndex(nodal_indices[ie_node], nodal_indices[je_node]);
666 mNonzeroEdgeValues[csr_index].Mass += mass_consistent(ie_node, je_node);
669 boost::numeric::ublas::bounded_matrix<double, TDim, TDim> &laplacian = mNonzeroEdgeValues[csr_index].LaplacianIJ;
670 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
671 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
672 laplacian(l_comp, k_comp) += dN_dx(ie_node, l_comp) * dN_dx(je_node, k_comp) *
volume;
676 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
678 gradient[l_comp] += dN_dx(je_node, l_comp) * weighted_volume;
682 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
683 transp_gradient[l_comp] += dN_dx(ie_node, l_comp) * weighted_volume;
689 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
691 mLumpedMassMatrix[nodal_indices[ie_node]] += mass_lumped[ie_node];
692 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
696 for (
unsigned int component = 0; component < TDim; component++)
697 gradient[component] += dN_dx(ie_node, component) * weighted_volume;
702 for (
unsigned int inode = 0; inode < mLumpedMassMatrix.size(); inode++)
704 mInvertedMassMatrix[inode] = mLumpedMassMatrix[inode];
710 for (
unsigned int inode = 0; inode < mInvertedMassMatrix.size(); inode++)
712 mInvertedMassMatrix[inode] = 1.0 / mInvertedMassMatrix[inode];
721 unsigned int GetCSRIndex(
unsigned int NodeI,
unsigned int NeighbourJ)
726 unsigned int csr_index;
728 for (csr_index = mRowStartIndex[NodeI]; csr_index != mRowStartIndex[NodeI + 1]; csr_index++)
729 if (mColumnIndex[csr_index] == NeighbourJ)
746 unsigned int csr_index;
748 for (csr_index = mRowStartIndex[NodeI]; csr_index != mRowStartIndex[NodeI + 1]; csr_index++)
749 if (mColumnIndex[csr_index] == NeighbourJ)
753 return &mNonzeroEdgeValues[csr_index];
765 mNonzeroEdgeValues.clear();
766 mColumnIndex.clear();
767 mRowStartIndex.clear();
768 mInvertedMassMatrix.clear();
769 mLumpedMassMatrix.clear();
770 mDiagGradientMatrix.clear();
787 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
789 #pragma omp parallel for firstprivate(n_nodes, it_begin)
792 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
795 unsigned int i_node =
i;
798 for (
unsigned int component = 0; component < TDim; component++)
799 (rDestination[i_node])[component] = (*node_it)[component];
819 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
821 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
823 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
826 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
829 unsigned int i_node =
i;
832 array_1d<double, 3> &vector = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
834 for (
unsigned int component = 0; component < TDim; component++)
835 (rDestination[i_node])[component] = vector[component];
849 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
851 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
853 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
856 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
859 unsigned int i_node =
i;
864 for (
unsigned int component = 0; component < TDim; component++)
865 (rDestination[i_node])[component] = vector[component];
878 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
880 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
882 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
885 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
888 unsigned int i_node =
i;
891 double &scalar = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
893 rDestination[i_node] = scalar;
904 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
906 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
908 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
911 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
915 unsigned int i_node =
i;
918 double &scalar = node_it->FastGetSolutionStepValue(rVariable, 1, var_pos);
920 rDestination[i_node] = scalar;
932 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
934 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
936 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
939 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
942 unsigned int i_node =
i;
945 array_1d<double, 3> &vector = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
947 for (
unsigned int component = 0; component < TDim; component++)
948 vector[component] = (rOrigin[i_node])[component];
960 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
962 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
964 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
967 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
973 double &scalar = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
975 scalar = rOrigin[i_node];
992 int loop_size = destination.size();
996 const double m_inv = Minv_vec[i_node];
1000 double temp = value * m_inv;
1001 for (
unsigned int comp = 0; comp < TDim; comp++)
1002 dest[comp] = origin_vec1[comp] +
temp * origin_value[comp];
1017 int loop_size = destination.size();
1020 double &dest = destination[i_node];
1021 const double m_inv = Minv_vec[i_node];
1022 const double &origin_vec1 = origin1[i_node];
1023 const double &origin_value = origin[i_node];
1025 double temp = value * m_inv;
1026 dest = origin_vec1 +
temp * origin_value;
1036 data_vector.resize(size);
1037 int loop_size = size;
1041 for (
unsigned int comp = 0; comp < TDim; comp++)
1048 data_vector.resize(size);
1049 int loop_size = size;
1052 data_vector[i_node] = 0.0;
1060 int loop_size = data_vector.size();
1064 data_vector[i_node].Mass = 0.0;
1073 int loop_size = data_vector.size();
1076 data_vector[i_node] = 0.0;
1082 int loop_size = data_vector.size();
1086 for (
unsigned int comp = 0; comp < TDim; comp++)
1093 int loop_size = data_vector.size();
1096 data_vector[i_node] = 0.0;
1105 int loop_size = origin.size();
1110 for (
unsigned int comp = 0; comp < TDim; comp++)
1111 dest[comp] = orig[comp];
1118 int loop_size = origin.size();
1121 destination[i_node] = origin[i_node];
1127 unsigned int mNumberEdges;
1152 void CalculateMassMatrix(boost::numeric::ublas::bounded_matrix<double, 3, 3> &mass_consistent,
double volume)
1154 for (
unsigned int i_node = 0; i_node <= TDim; i_node++)
1157 mass_consistent(i_node, i_node) = 0.16666666666666666667 *
volume;
1159 double temp = 0.08333333333333333333 *
volume;
1160 for (
unsigned int j_neighbour = i_node + 1; j_neighbour <= TDim; j_neighbour++)
1163 mass_consistent(i_node, j_neighbour) =
temp;
1164 mass_consistent(j_neighbour, i_node) =
temp;
1169 void CalculateMassMatrix(boost::numeric::ublas::bounded_matrix<double, 4, 4> &mass_consistent,
double volume)
1171 for (
unsigned int i_node = 0; i_node <= TDim; i_node++)
1174 mass_consistent(i_node, i_node) = 0.1 *
volume;
1177 for (
unsigned int j_neighbour = i_node + 1; j_neighbour <= TDim; j_neighbour++)
1180 mass_consistent(i_node, j_neighbour) =
temp;
1181 mass_consistent(j_neighbour, i_node) =
temp;
Definition: edge_data_c2c.h:80
void CalculateScalarLaplacian(double &l_ij)
Definition: edge_data_c2c.h:174
void CalculateConvectionStabilization_LOW(array_1d< double, TDim > &stab_low, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &U_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &U_j)
Definition: edge_data_c2c.h:260
void Sub_StabContribution(array_1d< double, TDim > &destination, const double tau, const double beta, const array_1d< double, TDim > &stab_low, const array_1d< double, TDim > &stab_high)
Definition: edge_data_c2c.h:351
array_1d< double, TDim > Ni_DNj
Definition: edge_data_c2c.h:88
void Add_div_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data_c2c.h:154
void Sub_Gp(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data_c2c.h:105
void Sub_div_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data_c2c.h:162
void CalculateConvectionStabilization_LOW(double &stab_low, const array_1d< double, TDim > &a_i, const double &phi_i, const array_1d< double, TDim > &a_j, const double &phi_j)
Definition: edge_data_c2c.h:273
void Add_StabContribution(double &destination, const double tau, const double beta, const double &stab_low, const double &stab_high)
Definition: edge_data_c2c.h:344
void CalculateConvectionStabilization_HIGH(double &stab_high, const array_1d< double, TDim > &a_i, const double &pi_i, const array_1d< double, TDim > &a_j, const double &pi_j)
Definition: edge_data_c2c.h:310
void Add_ConvectiveContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &U_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &U_j)
Definition: edge_data_c2c.h:181
void Sub_StabContribution(double &destination, const double tau, const double beta, const double &stab_low, const double &stab_high)
Definition: edge_data_c2c.h:359
void Sub_ConvectiveContribution(double &destination, const array_1d< double, TDim > &a_i, const double &phi_i, const array_1d< double, TDim > &a_j, const double &phi_j)
Definition: edge_data_c2c.h:211
void Sub_ConvectiveContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &U_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &U_j)
Definition: edge_data_c2c.h:196
array_1d< double, TDim > DNi_Nj
Definition: edge_data_c2c.h:91
void Add_Gp(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data_c2c.h:99
void Add_StabContribution(array_1d< double, TDim > &destination, const double tau, const double beta, const array_1d< double, TDim > &stab_low, const array_1d< double, TDim > &stab_high)
Definition: edge_data_c2c.h:336
void Sub_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data_c2c.h:143
void Sub_ViscousContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &U_i, const double &nu_i, const array_1d< double, TDim > &U_j, const double &nu_j)
Definition: edge_data_c2c.h:383
void Add_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data_c2c.h:137
double Mass
Definition: edge_data_c2c.h:83
void CalculateConvectionStabilization_HIGH(array_1d< double, TDim > &stab_high, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &pi_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &pi_j)
Definition: edge_data_c2c.h:286
void Sub_D_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data_c2c.h:124
void Add_ViscousContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &U_i, const double &nu_i, const array_1d< double, TDim > &U_j, const double &nu_j)
Definition: edge_data_c2c.h:369
void Add_ConvectiveContribution(double &destination, const array_1d< double, TDim > &a_i, const double &phi_i, const array_1d< double, TDim > &a_j, const double &phi_j)
Definition: edge_data_c2c.h:234
void Add_D_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data_c2c.h:116
boost::numeric::ublas::bounded_matrix< double, TDim, TDim > LaplacianIJ
Definition: edge_data_c2c.h:86
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
iterator begin()
Definition: global_pointers_vector.h:221
size_type size() const
Definition: global_pointers_vector.h:307
iterator end()
Definition: global_pointers_vector.h:229
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
Definition: edge_data_c2c.h:402
ValuesVectorType & GetLumpedMass()
Definition: edge_data_c2c.h:441
void AssignVectorToVector(const ValuesVectorType &origin, ValuesVectorType &destination)
Definition: edge_data_c2c.h:1115
vector< array_1d< double, TDim > > CalcVectorType
Definition: edge_data_c2c.h:411
void Add_Minv_value(CalcVectorType &destination, const CalcVectorType &origin1, const double value, const ValuesVectorType &Minv_vec, const CalcVectorType &origin)
Definition: edge_data_c2c.h:983
void FillCoordinatesFromDatabase(CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:780
~MatrixContainerC2C()
Definition: edge_data_c2c.h:417
void FillVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:810
CalcVectorType & GetDiagGradient()
Definition: edge_data_c2c.h:451
EdgesStructureTypeC2C< TDim > CSR_Tuple
Definition: edge_data_c2c.h:405
unsigned int GetNumberEdges()
Definition: edge_data_c2c.h:421
vector< double > ValuesVectorType
Definition: edge_data_c2c.h:410
void FillOldVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:841
vector< CSR_Tuple > EdgesVectorType
Definition: edge_data_c2c.h:406
EdgesVectorType & GetEdgeValues()
Definition: edge_data_c2c.h:426
IndicesVectorType & GetColumnIndex()
Definition: edge_data_c2c.h:431
void FillOldScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:899
IndicesVectorType & GetRowStartIndex()
Definition: edge_data_c2c.h:436
void Add_Minv_value(ValuesVectorType &destination, const ValuesVectorType &origin1, const double value, const ValuesVectorType &Minv_vec, const ValuesVectorType &origin)
Definition: edge_data_c2c.h:1008
ValuesVectorType & GetHmin()
Definition: edge_data_c2c.h:456
void SetToZero(EdgesVectorType &data_vector)
Definition: edge_data_c2c.h:1058
void SetToZero(IndicesVectorType &data_vector)
Definition: edge_data_c2c.h:1071
CSR_Tuple * GetTuplePointer(unsigned int NodeI, unsigned int NeighbourJ)
Definition: edge_data_c2c.h:741
void FillScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:871
vector< unsigned int > IndicesVectorType
Definition: edge_data_c2c.h:408
void AllocateAndSetToZero(ValuesVectorType &data_vector, int size)
Definition: edge_data_c2c.h:1046
unsigned int GetCSRIndex(unsigned int NodeI, unsigned int NeighbourJ)
Definition: edge_data_c2c.h:721
MatrixContainerC2C()
Definition: edge_data_c2c.h:415
void AssignVectorToVector(const CalcVectorType &origin, CalcVectorType &destination)
Definition: edge_data_c2c.h:1102
void BuildCSRData(ModelPart &model_part)
Definition: edge_data_c2c.h:584
void SetToZero(ValuesVectorType &data_vector)
Definition: edge_data_c2c.h:1091
ValuesVectorType & GetInvertedMass()
Definition: edge_data_c2c.h:446
void WriteVectorToDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:926
void AllocateAndSetToZero(CalcVectorType &data_vector, int size)
Definition: edge_data_c2c.h:1034
void Clear()
Definition: edge_data_c2c.h:761
void SetToZero(CalcVectorType &data_vector)
Definition: edge_data_c2c.h:1080
void WriteScalarToDatabase(Variable< double > &rVariable, ValuesVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data_c2c.h:954
void ConstructCSRVector(ModelPart &model_part)
Definition: edge_data_c2c.h:464
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
static void DivideInPartitions(const int NumTerms, const int NumThreads, PartitionVector &Partitions)
Divide an array of length NumTerms between NumThreads threads.
Definition: openmp_utils.h:158
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
model_part
Definition: face_heat.py:14
tau
Definition: generate_convection_diffusion_explicit_element.py:115
int n_nodes
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:15
int L
Definition: ode_solve.py:390
int k
Definition: quadrature.py:595
float temp
Definition: rotating_cone.py:85
int counter
Definition: script_THERMAL_CORRECT.py:218
N
Definition: sensitivityMatrix.py:29
volume
Definition: sp_statistics.py:15
integer i
Definition: TensorModule.f:17