Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/UG4/ugcore
Browse files Browse the repository at this point in the history
  • Loading branch information
junxiW committed Oct 19, 2023
2 parents 812f5ad + 4123266 commit d7d8cad
Show file tree
Hide file tree
Showing 28 changed files with 250 additions and 136 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12...3.27.1)

################################################
# ug4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Thus, the Import can be described by
\mathcal{I}: \mathbb{R}^d \times \mathbb{R} \times
\mathbb{R}^{N_1} \times \dots \times \mathbb{R}^{N_{n_{sys}}}
&\mapsto \mathcal{D} \\

\vec{x}, t, \vec{u}^1, \dots, \vec{u}^{n_{sys}}
&\mapsto \mathcal{I}(\vec{x}, t, \vec{u}^1, \dots, \vec{u}^{n_{sys}})
\f}
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/json_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ util = util or {}
-- If UG_JSON is active, load third party module as util.json
if IsDefinedUG_JSON() then

local jsonPath = ug_get_root_path().."externals/JSONForUG4/json-lua/"
local jsonPath = ug_get_root_path().."/externals/JSONForUG4/json-lua/"
package.path = package.path..";".. jsonPath.."?.lua"
util.json = require("json")

end
end
2 changes: 1 addition & 1 deletion ugbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# ugbase
################################################

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12...3.27.1)

project(P_UGBASE)

Expand Down
2 changes: 1 addition & 1 deletion ugbase/bindings/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12...3.27.1)

####
# uginterface Library
Expand Down
2 changes: 0 additions & 2 deletions ugbase/bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)

####
# ug_bridge Library
####
Expand Down
24 changes: 11 additions & 13 deletions ugbase/bridge/disc_bridges/user_data_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@ static void Dimension(Registry& reg, string grp)
reg.add_class_to_group(name, "IntervalNumberLinker", dimTag);
}

// GlobAttachmentElementUserData
{
typedef GlobAttachmentElementUserData<dim, number> T;
typedef CplUserData<number, dim> TBase;
string name = string("GlobAttachmentElementNumberData").append(dimSuffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(SmartPtr<Grid>, const char *) >("AttachmentName")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "GlobAttachmentElementNumberData", dimTag);
}

}

/**
Expand All @@ -519,19 +530,6 @@ static void Domain(Registry& reg, string grp)
string suffix = GetDomainSuffix<TDomain>();
string tag = GetDomainTag<TDomain>();

// GlobAttachmentElementUserData
{
string name = string("GlobAttachmentElementUserData").append(suffix);
typedef GlobAttachmentElementUserData<TDomain> T;
typedef CplUserData<number, dim> TBase;
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(SmartPtr<Grid>, const char *) >("AttachmentName")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "GlobAttachmentElementUserData", tag);

}


// User data of a subset indicator (1 in the subset, 0 everywhere else)
{
string name = string("SubsetIndicatorUserData").append(suffix);
Expand Down
2 changes: 1 addition & 1 deletion ugbase/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12...3.27.1)

################################################
# common
Expand Down
2 changes: 1 addition & 1 deletion ugbase/common/math/misc/math_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ int BinomCoeff(int n, int k);
* This method reflects a given vector at a plane specified by n and r0, i.e.
* the plane P is given such that for all \f$ \vec{x} in P \f$ it holds that
* \f[
* (\vec{x}- \vec{r0}) \cdot \vec{n} = 0.
* (\vec{x} - \vec{r0}) \cdot \vec{n} = 0.
* \f]
*
* @param vReflectedOut the reflected vector
Expand Down
2 changes: 0 additions & 2 deletions ugbase/common/node_tree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)

################################################
# node-tree
################################################
Expand Down
2 changes: 0 additions & 2 deletions ugbase/compile_info/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)

################################################
# ug4 - compile-info
################################################
Expand Down
2 changes: 1 addition & 1 deletion ugbase/lib_algebra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 2.8.12...3.27.1)

project (P_LIB_ALGEBRA)

Expand Down
6 changes: 3 additions & 3 deletions ugbase/lib_algebra/active_set/active_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class ActiveSet
/// constructor
ActiveSet() : m_bObs(false), m_spLagMultDisc(NULL) {
// specifies the number of fcts
value_type u_val;
m_nrFcts = GetSize(u_val);
//value_type u_val;
//m_nrFcts = GetSize(u_val); //ToDo: This field is only used in check_dist_to_obs which is commented out. Remove it completely?
};

/// sets obstacle gridfunction, which limits the solution u
Expand Down Expand Up @@ -187,7 +187,7 @@ class ActiveSet
SmartPtr<TDomain> m_spDom;

/// number of functions
size_t m_nrFcts;
//size_t m_nrFcts; //ToDo: This field is only used in check_dist_to_obs which is commented out. Remove it completely?

/// pointer to a gridfunction describing an obstacle-constraint
ConstSmartPtr<function_type> m_spObs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ VariableArray1<T>::resize(size_t newN, bool bCopyValues)
value_type *new_values = new T[newN];
UG_ASSERT(new_values != NULL, "out of memory");
if(new_values == NULL) return false;
memset(new_values, 0, sizeof(T)*newN); // todo: think about that
memset(reinterpret_cast<void *> (new_values), 0, sizeof(T)*newN); // todo: think about that

if(bCopyValues)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ VariableArray2<T, T_ordering>::resize(size_t newRows, size_t newCols, bool bCopy
}

value_type *new_values = new T[newRows*newCols];
memset(new_values, 0, sizeof(T)*newRows*newCols); // todo: think about that
memset(reinterpret_cast<void *> (new_values), 0, sizeof(T)*newRows*newCols); // todo: think about that
UG_ASSERT(new_values != NULL, "out of memory");
if(new_values==NULL) return false;
/*
Expand Down
2 changes: 1 addition & 1 deletion ugbase/lib_disc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12...3.27.1)

project(P_LIB_DISCRETIZATION)

Expand Down
4 changes: 2 additions & 2 deletions ugbase/lib_disc/domain_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void LoadDomain(TDomain& domain, const char* filename, int procId)

if(additionalSHNames.size()>0){
SmartPtr<ISubsetHandler> sh;
vector<SmartPtr<ISubsetHandler>> ash;
vector<SmartPtr<ISubsetHandler>> ash(additionalSHNames.size());
for(size_t i_name = 0; i_name < additionalSHNames.size(); ++i_name){
SmartPtr<ISubsetHandler> sh = domain.additional_subset_handler(additionalSHNames[i_name]);
ash[i_name]= sh;
Expand All @@ -79,7 +79,7 @@ void LoadDomain(TDomain& domain, const char* filename, int procId)
{
UG_THROW("LoadDomain: Could not load file: "<<filename);
}

if(num_ph > 0)
{
domain.set_refinement_projector(ph);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class StdExplicitGridFunctionData
case 1: eval<1>(u,elem,vCornerCoords,bDeriv); break;
case 2: eval<2>(u,elem,vCornerCoords,bDeriv); break;
case 3: eval<3>(u,elem,vCornerCoords,bDeriv); break;
default: UG_THROW("StdDependentUserData: Dimension not supported.");
default: UG_THROW("StdExplicitGridFunctionData: Dimension not supported.");
}
}

Expand All @@ -158,7 +158,7 @@ class StdExplicitGridFunctionData
case 1: eval<1>(u,elem,vCornerCoords,bDeriv); break;
case 2: eval<2>(u,elem,vCornerCoords,bDeriv); break;
case 3: eval<3>(u,elem,vCornerCoords,bDeriv); break;
default: UG_THROW("StdDependentUserData: Dimension not supported.");
default: UG_THROW("StdExplicitGridFunctionData: Dimension not supported.");
}
}

Expand Down Expand Up @@ -493,7 +493,7 @@ class ExplicitGridFunctionGradient

// store tmp Gradient
vJT = &(vJTTmp[0]);
}UG_CATCH_THROW("GridFunctionGradientData: failed.");
}UG_CATCH_THROW("ExplicitGridFunctionGradient: failed.");
}

// scale with coeficient
Expand Down
11 changes: 8 additions & 3 deletions ugbase/lib_disc/function_spaces/interpolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,17 +584,22 @@ template <typename TGridFunction>
void Interpolate(SmartPtr<UserData<number, TGridFunction::dim> > spInterpolFunction,
SmartPtr<TGridFunction> spGridFct, const char* cmp,
number time)
{Interpolate(spInterpolFunction, spGridFct, cmp, NULL, time);}
{
Interpolate(spInterpolFunction, spGridFct, cmp, NULL, time);
}
template <typename TGridFunction>
void Interpolate(SmartPtr<UserData<number, TGridFunction::dim> > spInterpolFunction,
SmartPtr<TGridFunction> spGridFct, const char* cmp,
const char* subsets)
{Interpolate(spInterpolFunction, spGridFct, cmp, subsets, 0.0);}
{
Interpolate(spInterpolFunction, spGridFct, cmp, subsets, 0.0);
}
template <typename TGridFunction>
void Interpolate(SmartPtr<UserData<number, TGridFunction::dim> > spInterpolFunction,
SmartPtr<TGridFunction> spGridFct, const char* cmp)
{
Interpolate(spInterpolFunction, spGridFct, cmp, NULL, 0.0);}
Interpolate(spInterpolFunction, spGridFct, cmp, NULL, 0.0);
}
//interpolate with diff_vector
template <typename TGridFunction>
void Interpolate(SmartPtr<UserData<number, TGridFunction::dim> > spInterpolFunction,
Expand Down
12 changes: 5 additions & 7 deletions ugbase/lib_disc/ordering_strategies/algorithms/downwindorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,16 @@ void OrderDownwindForDofDist(SmartPtr<DoFDistribution> dd, ConstSmartPtr<TDomain
std::vector<size_t>::iterator AdjIter;
std::vector<size_t> vAdjacency;

// count how many vertex were kept / removed per adjacency vector
size_t kept, removed = 0;
size_t initialcount = 0;

MathVector<TDomain::dim> vVel1, vPos1, vPos2, vDir1_2;
size_t i;
for (VertexIter = vvConnections.begin(), i=0; VertexIter != vvConnections.end(); VertexIter++, i++)
{
UG_DLOG(LIB_DISC_ORDER, 2, "Filtering vertex " << i << " adjacency vector." <<std::endl);
initialcount = VertexIter->size();
kept = 0;
removed = 0;
// count how many vertex were kept / removed per adjacency vector
#ifdef UG_ENABLE_DEBUG_LOGS
size_t initialcount = VertexIter->size();
#endif
size_t kept = 0, removed = 0;
// get position and velocity of first trait
vPos1 = vPositions.at(i).first;
(*spVelocity)(vVel1, vPos1, time, si);
Expand Down
Loading

1 comment on commit d7d8cad

@anaegel
Copy link
Member

@anaegel anaegel commented on d7d8cad Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LogashenkoDL: This merge may affect some of yout recent changes. Please review and come back with comments, if neccessary. Thx!

AFAIK, the only difference to the main branch should be commit 812f5ad

Please sign in to comment.