13 #if !defined(KRATOS_EDGE_DATA_H_INCLUDED)
14 #define KRATOS_EDGE_DATA_H_INCLUDED
17 #define USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
20 #define USE_CONSERVATIVE_FORM_FOR_VECTOR_CONVECTION
34 #include "utilities/geometry_utilities.h"
40 template <
unsigned int TDim>
48 boost::numeric::ublas::bounded_matrix<double, TDim, TDim>
LaplacianIJ;
63 for (
unsigned int comp = 0; comp < TDim; comp++)
64 destination[comp] -=
Ni_DNj[comp] * p_j -
DNi_Nj[comp] * p_i;
69 for (
unsigned int comp = 0; comp < TDim; comp++)
70 destination[comp] +=
Ni_DNj[comp] * p_j -
DNi_Nj[comp] * p_i;
82 for (
unsigned int comp = 0; comp < TDim; comp++)
83 destination +=
Ni_DNj[comp] * (v_j[comp] - v_i[comp]);
90 for (
unsigned int comp = 0; comp < TDim; comp++)
91 destination -=
Ni_DNj[comp] * (v_j[comp] - v_i[comp]);
101 for (
unsigned int comp = 0; comp < TDim; comp++)
102 destination[comp] +=
Ni_DNj[comp] * (p_j - p_i);
107 for (
unsigned int comp = 0; comp < TDim; comp++)
108 destination[comp] -=
Ni_DNj[comp] * (p_j - p_i);
120 for (
unsigned int comp = 0; comp < TDim; comp++)
121 destination -=
Ni_DNj[comp] * v_j[comp] -
DNi_Nj[comp] * v_i[comp];
128 for (
unsigned int comp = 0; comp < TDim; comp++)
129 destination +=
Ni_DNj[comp] * v_j[comp] -
DNi_Nj[comp] * v_i[comp];
139 for (
unsigned int comp = 1; comp < TDim; comp++)
148 #ifdef USE_CONSERVATIVE_FORM_FOR_VECTOR_CONVECTION
150 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
152 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
153 destination[l_comp] +=
temp * (U_j[l_comp] - U_i[l_comp]);
155 double aux_i = a_i[0] *
Ni_DNj[0];
156 double aux_j = a_j[0] *
Ni_DNj[0];
157 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
159 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
160 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
162 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
163 destination[l_comp] += aux_j * U_j[l_comp] - aux_i * U_i[l_comp];
172 #ifdef USE_CONSERVATIVE_FORM_FOR_VECTOR_CONVECTION
174 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
176 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
177 destination[l_comp] -=
temp * (U_j[l_comp] - U_i[l_comp]);
179 double aux_i = a_i[0] *
Ni_DNj[0];
180 double aux_j = a_j[0] *
Ni_DNj[0];
181 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
183 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
184 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
186 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
187 destination[l_comp] -= aux_j * U_j[l_comp] - aux_i * U_i[l_comp];
196 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
198 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
201 destination -=
temp * (phi_j - phi_i);
203 double aux_i = a_i[0] *
Ni_DNj[0];
204 double aux_j = a_j[0] *
Ni_DNj[0];
205 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
207 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
208 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
210 destination -= aux_j * phi_j - aux_i * phi_i;
219 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
221 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
224 destination +=
temp * (phi_j - phi_i);
226 double aux_i = a_i[0] *
Ni_DNj[0];
227 double aux_j = a_j[0] *
Ni_DNj[0];
228 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
230 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
231 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
233 destination += aux_j * phi_j - aux_i * phi_i;
244 double conv_stab = 0.0;
245 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
246 for (
unsigned int m_comp = 0; m_comp < TDim; m_comp++)
247 conv_stab += a_i[k_comp] * a_i[m_comp] *
LaplacianIJ(k_comp, m_comp);
248 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
249 stab_low[l_comp] = conv_stab * (U_j[l_comp] - U_i[l_comp]);
256 double conv_stab = 0.0;
257 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
258 for (
unsigned int m_comp = 0; m_comp < TDim; m_comp++)
259 conv_stab += a_i[k_comp] * a_i[m_comp] *
LaplacianIJ(k_comp, m_comp);
260 stab_low = conv_stab * (phi_j - phi_i);
270 #ifdef USE_CONSERVATIVE_FORM_FOR_VECTOR_CONVECTION
272 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
274 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
275 stab_high[l_comp] = -
temp * (pi_j[l_comp] - pi_i[l_comp]);
277 double aux_i = a_i[0] *
Ni_DNj[0];
278 double aux_j = a_j[0] *
Ni_DNj[0];
279 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
281 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
282 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
284 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
285 stab_high[l_comp] = -(aux_j * pi_j[l_comp] - aux_i * pi_i[l_comp]);
294 #ifdef USE_CONSERVATIVE_FORM_FOR_SCALAR_CONVECTION
296 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
299 stab_high = -
temp * (pi_j - pi_i);
301 double aux_i = a_i[0] *
Ni_DNj[0];
302 double aux_j = a_j[0] *
Ni_DNj[0];
303 for (
unsigned int k_comp = 1; k_comp < TDim; k_comp++)
305 aux_i += a_i[k_comp] *
Ni_DNj[k_comp];
306 aux_j += a_j[k_comp] *
Ni_DNj[k_comp];
309 stab_high = -(aux_j * pi_j - aux_i * pi_i);
316 const double tau,
const double beta,
319 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
320 destination[l_comp] +=
tau * (stab_low[l_comp] - beta * stab_high[l_comp]);
324 const double tau,
const double beta,
325 const double &stab_low,
const double &stab_high)
327 destination +=
tau * (stab_low - beta * stab_high);
331 const double tau,
const double beta,
334 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
335 destination[l_comp] -=
tau * (stab_low[l_comp] - beta * stab_high[l_comp]);
339 const double tau,
const double beta,
340 const double &stab_low,
const double &stab_high)
342 destination -=
tau * (stab_low - beta * stab_high);
354 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
358 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
359 destination[l_comp] += nu_i *
L * (U_j[l_comp] - U_i[l_comp]);
368 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
372 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
373 destination[l_comp] -= nu_i *
L * (U_j[l_comp] - U_i[l_comp]);
379 template <
unsigned int TDim,
class TSparseSpace>
407 return mNonzeroEdgeValues;
417 return mRowStartIndex;
422 return mLumpedMassMatrix;
427 return mInvertedMassMatrix;
432 return mDiagGradientMatrix;
458 for (
typename ModelPart::NodesContainerType::iterator node_it =
model_part.NodesBegin(); node_it !=
model_part.NodesEnd(); node_it++)
461 mNumberEdges += (node_it->GetValue(NEIGHBOUR_NODES)).size();
466 node_it->FastGetSolutionStepValue(AUX_INDEX) =
static_cast<double>(i_node++);
470 KRATOS_WATCH(
"ERROR - Highest nodal index doesn't coincide with number of nodes!");
473 mNonzeroEdgeValues.resize(mNumberEdges);
475 mColumnIndex.resize(mNumberEdges);
477 mRowStartIndex.resize(
n_nodes + 1);
479 mLumpedMassMatrix.resize(
n_nodes);
481 mInvertedMassMatrix.resize(
n_nodes);
483 mDiagGradientMatrix.resize(
n_nodes);
491 unsigned int row_start_temp = 0;
494 std::vector<int> row_partition(number_of_threads);
497 for (
int k = 0;
k < number_of_threads;
k++)
503 for (
unsigned int aux_i =
static_cast<unsigned int>(row_partition[
k]); aux_i < static_cast<unsigned int>(row_partition[
k + 1]); aux_i++)
505 typename ModelPart::NodesContainerType::iterator node_it =
model_part.NodesBegin() + aux_i;
508 i_node =
static_cast<unsigned int>(node_it->FastGetSolutionStepValue(AUX_INDEX));
514 unsigned int n_neighbours = neighb_nodes.
size();
517 std::vector<unsigned int> work_array;
518 work_array.reserve(n_neighbours);
525 work_array.push_back(
static_cast<unsigned int>(neighb_it->FastGetSolutionStepValue(AUX_INDEX)));
528 std::sort(work_array.begin(), work_array.end());
531 mRowStartIndex[i_node] = row_start_temp;
536 unsigned int j_neighbour = work_array[
counter];
538 unsigned int csr_index = mRowStartIndex[i_node] +
counter;
541 mColumnIndex[csr_index] = j_neighbour;
544 row_start_temp += n_neighbours;
549 mRowStartIndex[
n_nodes] = mNumberEdges;
554 mHmin[i_node] = 1e10;
573 boost::numeric::ublas::bounded_matrix<double, TDim + 1, TDim> dN_dx;
577 double weighting_factor = 1.0 /
static_cast<double>(TDim + 1);
579 boost::numeric::ublas::bounded_matrix<double, TDim + 1, TDim + 1> mass_consistent;
588 for (
typename ModelPart::ElementsContainerType::iterator elem_it =
model_part.ElementsBegin(); elem_it !=
model_part.ElementsEnd(); elem_it++)
596 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
598 heights[ie_node] = dN_dx(ie_node, 0) * dN_dx(ie_node, 0);
599 for (
unsigned int comp = 1; comp < TDim; comp++)
601 heights[ie_node] += dN_dx(ie_node, comp) * dN_dx(ie_node, comp);
603 heights[ie_node] = 1.0 / sqrt(heights[ie_node]);
608 CalculateMassMatrix(mass_consistent,
volume);
610 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
612 for (
unsigned int je_node = 0; je_node <= TDim; je_node++)
615 mass_lumped[ie_node] += mass_consistent(ie_node, je_node);
620 double weighted_volume =
volume * weighting_factor;
625 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
626 nodal_indices[ie_node] =
static_cast<unsigned int>(elem_it->GetGeometry()[ie_node].FastGetSolutionStepValue(AUX_INDEX));
629 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
632 if (mHmin[nodal_indices[ie_node]] > heights[ie_node])
633 mHmin[nodal_indices[ie_node]] = heights[ie_node];
635 for (
unsigned int je_node = 0; je_node <= TDim; je_node++)
639 if (ie_node != je_node)
642 unsigned int csr_index =
GetCSRIndex(nodal_indices[ie_node], nodal_indices[je_node]);
646 mNonzeroEdgeValues[csr_index].Mass += mass_consistent(ie_node, je_node);
649 boost::numeric::ublas::bounded_matrix<double, TDim, TDim> &laplacian = mNonzeroEdgeValues[csr_index].LaplacianIJ;
650 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
651 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
652 laplacian(l_comp, k_comp) += dN_dx(ie_node, l_comp) * dN_dx(je_node, k_comp) *
volume;
656 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
658 gradient[l_comp] += dN_dx(je_node, l_comp) * weighted_volume;
662 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
663 transp_gradient[l_comp] += dN_dx(ie_node, l_comp) * weighted_volume;
669 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
671 mLumpedMassMatrix[nodal_indices[ie_node]] += mass_lumped[ie_node];
672 for (
unsigned int ie_node = 0; ie_node <= TDim; ie_node++)
676 for (
unsigned int component = 0; component < TDim; component++)
678 gradient[component] += dN_dx(ie_node, component) * weighted_volume;
683 for (
unsigned int inode = 0; inode < mLumpedMassMatrix.size(); inode++)
685 mInvertedMassMatrix[inode] = mLumpedMassMatrix[inode];
689 for (
unsigned int inode = 0; inode < mInvertedMassMatrix.size(); inode++)
691 mInvertedMassMatrix[inode] = 1.0 / mInvertedMassMatrix[inode];
700 unsigned int GetCSRIndex(
unsigned int NodeI,
unsigned int NeighbourJ)
705 unsigned int csr_index;
707 for (csr_index = mRowStartIndex[NodeI]; csr_index != mRowStartIndex[NodeI + 1]; csr_index++)
708 if (mColumnIndex[csr_index] == NeighbourJ)
725 unsigned int csr_index;
727 for (csr_index = mRowStartIndex[NodeI]; csr_index != mRowStartIndex[NodeI + 1]; csr_index++)
728 if (mColumnIndex[csr_index] == NeighbourJ)
732 return &mNonzeroEdgeValues[csr_index];
744 mNonzeroEdgeValues.clear();
745 mColumnIndex.clear();
746 mRowStartIndex.clear();
747 mInvertedMassMatrix.clear();
748 mLumpedMassMatrix.clear();
749 mDiagGradientMatrix.clear();
766 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
768 #pragma omp parallel for firstprivate(n_nodes, it_begin)
771 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
775 unsigned int i_node =
i;
778 for (
unsigned int component = 0; component < TDim; component++)
779 (rDestination[i_node])[component] = (*node_it)[component];
799 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
801 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
803 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
806 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
809 unsigned int i_node =
i;
812 array_1d<double, 3> &vector = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
814 for (
unsigned int component = 0; component < TDim; component++)
815 (rDestination[i_node])[component] = vector[component];
829 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
831 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
833 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
836 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
839 unsigned int i_node =
i;
844 for (
unsigned int component = 0; component < TDim; component++)
845 (rDestination[i_node])[component] = vector[component];
858 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
860 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
862 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
865 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
868 unsigned int i_node =
i;
871 double &scalar = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
873 rDestination[i_node] = scalar;
884 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
886 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
888 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
891 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
894 unsigned int i_node =
i;
897 double &scalar = node_it->FastGetSolutionStepValue(rVariable, 1, var_pos);
899 rDestination[i_node] = scalar;
911 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
913 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
915 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
918 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
921 unsigned int i_node =
i;
924 array_1d<double, 3> &vector = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
926 for (
unsigned int component = 0; component < TDim; component++)
927 vector[component] = (rOrigin[i_node])[component];
939 ModelPart::NodesContainerType::iterator it_begin = rNodes.begin();
941 unsigned int var_pos = it_begin->pGetVariablesList()->Index(rVariable);
943 #pragma omp parallel for firstprivate(n_nodes, it_begin, var_pos)
946 ModelPart::NodesContainerType::iterator node_it = it_begin +
i;
952 double &scalar = node_it->FastGetCurrentSolutionStepValue(rVariable, var_pos);
954 scalar = rOrigin[i_node];
972 int loop_size = destination.size();
976 const double m_inv = Minv_vec[i_node];
980 double temp = value * m_inv;
981 for (
unsigned int comp = 0; comp < TDim; comp++)
982 dest[comp] = origin_vec1[comp] +
temp * origin_value[comp];
997 int loop_size = destination.size();
1000 double &dest = destination[i_node];
1001 const double m_inv = Minv_vec[i_node];
1002 const double &origin_vec1 = origin1[i_node];
1003 const double &origin_value = origin[i_node];
1005 double temp = value * m_inv;
1006 dest = origin_vec1 +
temp * origin_value;
1016 data_vector.resize(size);
1017 int loop_size = size;
1021 for (
unsigned int comp = 0; comp < TDim; comp++)
1028 data_vector.resize(size);
1029 int loop_size = size;
1032 data_vector[i_node] = 0.0;
1040 int loop_size = data_vector.size();
1044 data_vector[i_node].Mass = 0.0;
1053 int loop_size = data_vector.size();
1056 data_vector[i_node] = 0.0;
1062 int loop_size = data_vector.size();
1066 for (
unsigned int comp = 0; comp < TDim; comp++)
1073 int loop_size = data_vector.size();
1076 data_vector[i_node] = 0.0;
1085 int loop_size = origin.size();
1090 for (
unsigned int comp = 0; comp < TDim; comp++)
1091 dest[comp] = orig[comp];
1098 int loop_size = origin.size();
1101 destination[i_node] = origin[i_node];
1107 unsigned int mNumberEdges;
1132 void CalculateMassMatrix(boost::numeric::ublas::bounded_matrix<double, 3, 3> &mass_consistent,
double volume)
1134 for (
unsigned int i_node = 0; i_node <= TDim; i_node++)
1137 mass_consistent(i_node, i_node) = 0.16666666666666666667 *
volume;
1139 double temp = 0.08333333333333333333 *
volume;
1140 for (
unsigned int j_neighbour = i_node + 1; j_neighbour <= TDim; j_neighbour++)
1143 mass_consistent(i_node, j_neighbour) =
temp;
1144 mass_consistent(j_neighbour, i_node) =
temp;
1149 void CalculateMassMatrix(boost::numeric::ublas::bounded_matrix<double, 4, 4> &mass_consistent,
double volume)
1151 for (
unsigned int i_node = 0; i_node <= TDim; i_node++)
1154 mass_consistent(i_node, i_node) = 0.1 *
volume;
1157 for (
unsigned int j_neighbour = i_node + 1; j_neighbour <= TDim; j_neighbour++)
1160 mass_consistent(i_node, j_neighbour) =
temp;
1161 mass_consistent(j_neighbour, i_node) =
temp;
Definition: edge_data.h:42
void Sub_D_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data.h:86
array_1d< double, TDim > Ni_DNj
Definition: edge_data.h:50
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.h:362
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.h:315
void Add_StabContribution(double &destination, const double tau, const double beta, const double &stab_low, const double &stab_high)
Definition: edge_data.h:323
void Add_Gp(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:61
void Sub_Gp(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:67
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.h:252
boost::numeric::ublas::bounded_matrix< double, TDim, TDim > LaplacianIJ
Definition: edge_data.h:48
double Mass
Definition: edge_data.h:45
void CalculateScalarLaplacian(double &l_ij)
Definition: edge_data.h:136
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.h:214
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.h:167
void Sub_StabContribution(double &destination, const double tau, const double beta, const double &stab_low, const double &stab_high)
Definition: edge_data.h:338
void Add_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:99
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.h:330
void Sub_div_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data.h:124
array_1d< double, TDim > DNi_Nj
Definition: edge_data.h:53
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.h:143
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.h:265
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.h:289
void Add_div_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data.h:116
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.h:191
void Add_D_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data.h:78
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.h:348
void Sub_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:105
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.h:240
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.h:381
EdgesStructureType< TDim > CSR_Tuple
Definition: edge_data.h:384
void WriteVectorToDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:905
void AssignVectorToVector(const CalcVectorType &origin, CalcVectorType &destination)
Definition: edge_data.h:1082
ValuesVectorType & GetLumpedMass()
Definition: edge_data.h:420
void FillOldScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:879
void SetToZero(EdgesVectorType &data_vector)
Definition: edge_data.h:1038
~MatrixContainer()
Definition: edge_data.h:396
void BuildCSRData(ModelPart &model_part)
Definition: edge_data.h:563
CalcVectorType & GetDiagGradient()
Definition: edge_data.h:430
void ConstructCSRVector(ModelPart &model_part)
Definition: edge_data.h:443
void AssignVectorToVector(const ValuesVectorType &origin, ValuesVectorType &destination)
Definition: edge_data.h:1095
MatrixContainer()
Definition: edge_data.h:394
vector< double > ValuesVectorType
Definition: edge_data.h:389
IndicesVectorType & GetColumnIndex()
Definition: edge_data.h:410
vector< unsigned int > IndicesVectorType
Definition: edge_data.h:387
unsigned int GetCSRIndex(unsigned int NodeI, unsigned int NeighbourJ)
Definition: edge_data.h:700
void Add_Minv_value(ValuesVectorType &destination, const ValuesVectorType &origin1, const double value, const ValuesVectorType &Minv_vec, const ValuesVectorType &origin)
Definition: edge_data.h:988
ValuesVectorType & GetInvertedMass()
Definition: edge_data.h:425
void Clear()
Definition: edge_data.h:740
IndicesVectorType & GetRowStartIndex()
Definition: edge_data.h:415
void FillVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:790
void FillScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:851
vector< CSR_Tuple > EdgesVectorType
Definition: edge_data.h:385
void SetToZero(CalcVectorType &data_vector)
Definition: edge_data.h:1060
void WriteScalarToDatabase(Variable< double > &rVariable, ValuesVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:933
vector< array_1d< double, TDim > > CalcVectorType
Definition: edge_data.h:390
void Add_Minv_value(CalcVectorType &destination, const CalcVectorType &origin1, const double value, const ValuesVectorType &Minv_vec, const CalcVectorType &origin)
Definition: edge_data.h:963
void FillOldVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:821
void AllocateAndSetToZero(ValuesVectorType &data_vector, int size)
Definition: edge_data.h:1026
void AllocateAndSetToZero(CalcVectorType &data_vector, int size)
Definition: edge_data.h:1014
void SetToZero(IndicesVectorType &data_vector)
Definition: edge_data.h:1051
void FillCoordinatesFromDatabase(CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:759
CSR_Tuple * GetTuplePointer(unsigned int NodeI, unsigned int NeighbourJ)
Definition: edge_data.h:720
ValuesVectorType & GetHmin()
Definition: edge_data.h:435
unsigned int GetNumberEdges()
Definition: edge_data.h:400
EdgesVectorType & GetEdgeValues()
Definition: edge_data.h:405
void SetToZero(ValuesVectorType &data_vector)
Definition: edge_data.h:1071
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